On Friday, July 4, 2014 1:08:41 AM UTC+2, Aaron Meurer wrote: > > I see. Wouldn't the pattern matcher not match in that case, because > Basic(a, b, c, d) has four arguments and Symbol('x') has none? > > Suppose you have Symbol(wild_sequence), i.e. ordinary wilds match only one node, while wild sequences can match many nodes.
Also, the issue of exact subtree matching vs partial subtree matching should be addressed. By exact subtree matching I mean that you pick a node in the expression, and find a replacement for the wilds in order to have the exact subtree. Partial subtree instead would not cover all subnodes. This can be useful if you have a long argument sequence in Add( ... ) or Mul( ... ) and you want to pick some subrange or subset (subset for commutative args, subrange otherwise) of elements matching a given pattern, disregarding all other elements. -- 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/141109ea-a485-4e9c-9e1e-ba9e511eda0c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.