Comment #21 on issue 1337 by asmeurer: find all instances in an expression
http://code.google.com/p/sympy/issues/detail?id=1337
atoms seems to be a little slower (though not by much):
In [10]: %timeit f.atoms(tan)
10000 loops, best of 3: 90.5 us per loop
In [11]: %timeit f.find(tan)
10000 loops, best of 3: 55.2 us per loop
So perhaps we should unify these, at least in the underlying code.
By the way, this can be very useful for an expression rewriting function
(like a simplification function) because you can just do
a = list(expr.find(what_you_want))
b = [make_a_little_different(i) for i in a]
expr = expr.subs(zip(a, b))
instead of trying to walk the expression tree with .args and a bunch of
conditionals.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.