Status: Accepted
Owner: asmeurer
CC: smichr
Labels: Type-Enhancement Priority-Medium Matching
New issue 2026 by asmeurer: Exact substitution
http://code.google.com/p/sympy/issues/detail?id=2026
This has been discussed several times, but I don't think an issue has ever
been created for it. There needs to be a way to bypass all the algebraic
tricks that subs uses, such as these:
In [1]: exp(2*x).subs(exp(x), y)
Out[1]:
2
y
In [2]: (x + 1).subs(x + 2, y)
Out[2]: -1 + y
The first one in particular was screwing me up for the Risch Algorithm
(issue 2010), so I had to temporarily disable entirely it in my branch.
Now don't get me wrong. There are times when I want subs to be as smart as
possible (there are cases of this in the Risch Algorithm too, actually),
but there are also times when I don't. So there needs to be a flag
expr.subs(old, new, exact=True) that only does substitution if the
expression old is exactly in expr.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.