There is a function is_unit() in symbolic/units.py, so you just need to walk the expression tree using the ExpressionTreeWalker class in symbolic/expression_conversions.py. I would first check for symbol with ex.is_symbol() which is very fast. See DefiniteSumExpander for example.
Regards, -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
