> I think we should make it so that cos(4*x + 6).replace(2*x + 3, u) works.
>
That would be nice. Also, Francesco's wildcard replacement looks buggy.
The `4*x` apparently matches twice, once for 4 and once for x:
In [1]: u = symbols('u')
In [2]: w = Wild('w')
In [3]: cos(4*x+6).replace(w*(2*x+3), u*w, map=True)
Out[3]:
⎛ ⎛ 2 ⎞ ⎞
⎜ ⎜ 4⋅u ⋅x 6⋅u ⎟ ⎧ 4⋅u 6⋅u u⋅x ⎫⎟
⎜cos⎜────────── + ───────⎟, ⎨4: ───────, 6: ───────, x: ───────⎬⎟
⎜ ⎜ 2 2⋅x + 3⎟ ⎩ 2⋅x + 3 2⋅x + 3 2⋅x + 3⎭⎟
⎝ ⎝(2⋅x + 3) ⎠ ⎠
This seems to contradict the documentation's claims that "changes made are
targeted only once" and "changes are not made twice". I thought maybe I
just misunderstood the `simultaneous` flag, but that makes things even
worse. Or am I misunderstanding that?
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/73479995-1233-494e-b521-48a9d4e6ee12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.