On Mon, Apr 30, 2012 at 12:51 PM, Aaron Meurer <asmeu...@gmail.com> wrote: > I just mean it doesn't have to be subs that does this. It could be > some other method, like replace, or something new. I'm not sure if > such functionality belongs as a hint to subs or as a different method. >
Not sure, but we have subs, replace, xreplace and transform that all handle different situations involving substitution. I think that things could get a little confusing if this were all wrapped into subs. Maybe this case isn't too bad, however. It represents old/new being callable/callable if this is detected it could just be passed off to replace. So `(1 - cos(x) + cos(2*x)).subs(cos, lambda x: 1 - x**2/2)` -> `-3*x**2/2 + 1`. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@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.