You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's something about "not E" or "~E" that the parser doesn't like. Notice other letters and "E" alone are fine:
>>> import sympy
>>> sympy.parsing.sympy_parser.parse_expr('A')
A
>>> sympy.parsing.sympy_parser.parse_expr('E')
E
>>> sympy.parsing.sympy_parser.parse_expr('~E')
Traceback (most recent call last):
...
TypeError: bad operand type for unary ~: 'Exp1'
The text was updated successfully, but these errors were encountered:
lwerdna
changed the title
Unable to parse a boolean expression with a variable named 'E'
Unable to parse a boolean expression with "~E"
May 27, 2020
I found that parsing "I" raises TypeError: bad operand type for unary ~: 'ImaginaryUnit' so then I looked into the local_dict and global_dict keyword arguments. I thought that since they were by default None, it meant no variable lookup during parsing. I didn't realize it means it won't override the default variables. My mistake, sorry if this was any inconvenience.
There's something about "not E" or "~E" that the parser doesn't like. Notice other letters and "E" alone are fine:
The text was updated successfully, but these errors were encountered: