On Monday, June 23, 2014 5:02:27 PM UTC+2, F. B. wrote: > > I mean, you can use the "alternatives" to match more patterns at the same > time. Something like: > > x_**n_ | x_ > > which would match both Symbol("x") and Pow(x, n). >
This is also an example in which default values could be useful. In case x_ is matched, n_ should be defaulted to 1. -- 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 sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/ea12023d-6cea-43e9-ac98-99854c12527a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.