Comment #8 on issue 3698 by asmeu...@gmail.com: Piecewise does solving with subs
http://code.google.com/p/sympy/issues/detail?id=3698

Really there are three issues here that bother me:

- The constructor of Piecewise and .subs are performing different semantics.

- Doing this is too much magic for either (especially since solve can be slow in general). This is better suited to a separate simplify method that is not called automatically.

- Doing it is technically incorrect, since solve() is not as powerful as the code assumes it is.

If you agree with any point in that list, then the points above it become irrelevant, hence I've been trying to argue the last point. But even if solve() were perfect, I would still argue the first two points.

For example, the second point surprised me, and for a bit I thought that something strange was going on in your pull request when I removed the code from DifferentialExtension, because it was still giving x == 1 even though from what I could tell it should have been giving log(x) == 0. It was one of those "clear the .pyc files and hope that helps" moments.

And the first point confused me further when I went to test it, because when I entered Piecewise((..., Eq(log(x), 0)), it gave me just that. It wasn't until I very carefully did exactly what the code said (i.e., use subs on a dummy variable) that I noticed what was going on.

It's not part of the Zen of Python, but there's something to be said about the so-called "principle of least astonishment" here.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy-issues+unsubscr...@googlegroups.com.
To post to this group, send email to sympy-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to