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 ?
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/0987ccd8-66d0-468b-ab1c-9035732cae11n%40googlegroups.com.