inducer / pymbolic

A simple package to do symbolic math (focus on code gen and DSLs)
http://mathema.tician.de/software/pymbolic
Other
108 stars 25 forks source link

[parser] Cannot parse boolean literals #40

Closed kaushikcfd closed 1 year ago

kaushikcfd commented 3 years ago

Minimal reproducer:

In [1]: import pymbolic as p

In [2]: p.parse("True")
Out[2]: Variable('True')

In [3]: p.parse("False")
Out[3]: Variable('False')
iandinwoodie commented 1 year ago

@kaushikcfd any reason this is still open after #58 was merged?

kaushikcfd commented 1 year ago

Yep, it was indeed fixed. Thanks!

For posterity, it can be verified as:

>>> import pymbolic as p
>>> p.__version__
'2022.2'
>>> p.parse("False")
False
>>> p.parse("True")
True
>>> p.parse("True or False")
LogicalOr((True, False))