Some of Eq's problems:

In [1]: srepr(Eq(x, y)*2)
Out[1]: "Mul(Integer(2), Equality(Symbol('x'), Symbol('y')))"

In [2]: Eq(x, y)*2
Out[2]: 2⋅x = y

The formatted output is wrong, the tree expression corresponds to Mul(2, 
Eq(x, y)), not to Eq(Mul(2, x), y) as it looks like in the formatted output.

In any case, I would suggest to change the behavior to the one displayed in 
Out[2] even in the expression tree, both for Eq( ... ) * ... and for Eq( 
... ) + ...

In [3]: Eq(x, y) + Eq(z, t)
Out[3]: x = y + z = t

In [4]: srepr(Eq(x, y)+Eq(z, t))
Out[4]: "Add(Equality(Symbol('x'), Symbol('y')), Equality(Symbol('z'), 
Symbol('t')))"

Again, maybe this should rather produce Eq(x+z, y+t)?

By the way, is there any way to swap the hand-sides of Equality? Otherwise 
it could be easily added something like:

>>> Eq(x, y).swap_hs()
y == x

-- 
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/3e796ff4-a1ca-41e5-9987-e6169e8201d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to