<copied from issue 2059> Just a follow up about using subs(wild=True). If Idx is derived from Expr rather than Basic, then the wild subs shown below (in t2) works:
>>> eq=A*M(i, j)**n + B*M(1 + i, j)**(1 + n)- D*M(i, j)**(1 + n) >>> Eq(*reversed(collect(eq.subs(w**(1+n), w**(1+n)*u, wild=True), >>> u).as_independent( u))).subs(u, 1) B*M(1 + i, j)**(1 + n) - D*M(i, j)**(1 + >>> n) == A*M(i, j)**n >>> I still think the lambda for collection, as_independent (and coefficient, atoms, has, subs, etc...) would be useful. Also, something that would be nice in the wild=True subs would be if there was a way to refer (as in a grep pattern) to the thing that was found. What could be used for that -- the no-name Dummy as in C.Dummy(''): >>> C.Dummy('') _ >>> _.name '' -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.