Status: Accepted
Owner: [email protected]
Labels: Type-Enhancement Priority-Medium
New issue 2738 by [email protected]: Make a distinction between
operations and their result
http://code.google.com/p/sympy/issues/detail?id=2738
Supporting unevaluated operations like Mul(3, 4, evaluate=False) occasions
a lot of headaches (for instance issue 2684). I think that the root cause
of this is that we try to represent 2 very different concepts with a single
class.
So the idea would be to have a class OpMul representing the multiplication
operation itself, IOW a "multiply" node in an abstract expression tree.
When we write "3 * 4 = 12", "3 * 4" means the operation of multiplying 3 by
4, and the equation expresses that the result of the operation is 12. Note
that "3 * 4" is a different operation from "4 * 3" or "6 * 2", even though
they all have the same result, so we should have OpMul(3, 4) != OpMul(4,
3) != OpMul(6, 2) but OpMul(3, 4).result() == OpMul(4, 3).result() ==
OpMul(6, 2).result(). To generate "3 * 4 = 12", we could then do something
like:
op = OpMul(3, 4)
print op, '=', op.result()
3 * 4 = 12
If we implement issue 1887, the last statement could use Eqn(op,
op.result()). (BTW, the distinction between Eq and Eqn is rather similar to
that between Mul and OpMul)
--
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.