On Mar 29, 6:56 am, "Aaron S. Meurer" <asmeu...@gmail.com> wrote: > So, either everything should have Basic args, which means no None, tuples, > etc., or we could have some kind of helper method in Basic that returns a > list of only the symbolic arguments. For the second one, you would modify > the list with what you want, and then send it back to the same object through > some other method, and it puts everything back where it belongs (it doesn't > have to be in place, though).
Maybe just a method to apply an arbitrary function to arguments. I've got a prototype in commit "apply" just before quartz in branch 1766. It handles Integrals, Derivatives and Functions in a deep sense. From the docstring: >>> foo = lambda x: x/2 >>> for eq in [Integral(sin(x), (x, 1,a)), sin(x+cos(x))]: ... for deep in [0, 1]: ... for dobare in [0, 1]: ... print 'deep=%i, dobare=%i'%(deep, dobare), apply(eq, foo, deep, dobare) ... deep=0, dobare=0 Integral(sin(x), (x, 1, a)) deep=0, dobare=1 Integral(sin(x), (x, 1, a))/2 deep=1, dobare=0 Integral(sin(x/2), (x, 1/2, a/2)) deep=1, dobare=1 Integral(sin(x/2), (x, 1/2, a/2))/2 deep=0, dobare=0 sin(x + cos(x)) deep=0, dobare=1 sin(x + cos(x))/2 deep=1, dobare=0 sin(x/2 + cos(x/2)) deep=1, dobare=1 sin(x/2 + cos(x/2))/2 Notice that it leaves the integration variables alone. -- 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.