Hi there.
I am trying to test the root of expression tree, for example:
expr = sympify("somefunc(2-5)")
if
expr.func.name =="somefunc":
call_func_1()
else:
call_func_2()
It works just fine, but when I change the expression, for example, to
expr = sympify("5+6")
Code throws the exception, with error:
AttributeError: type object 'Add' has no attribute 'name'
I don't understand, why Add class has no attribute "name". Or what attribute has all the classes, so I can test the head of any expression without code exception?
What code should I write ?