Eq is a mathematical equality, but it's also unevaluated, so that doesn't really help.
This is just a bug in the printer. It should not sort the args on unevaluated Add. Is there a way to detect that an Add was created with evaluate=False? Aaron Meurer On Wed, Apr 30, 2014 at 2:40 AM, F. B. <[email protected]> wrote: > I think it's a problem with the printer: > > In [1]: a = Add(3, 2, evaluate=False) > > In [2]: a.args > Out[2]: (3, 2) > > In [3]: a > Out[3]: 2 + 3 > > The args are created in the correct order, it's the printer that apparently > reorders the values. The structural equality is False because (2, 3) is not > the same as (3, 2), and that sounds correct. Use Eq( , ) for mathematical > equalities. > > > On Wednesday, April 30, 2014 8:53:50 AM UTC+2, Duane Nykamp wrote: >> >> I really like how unevaluated operators are working. However, one >> confusing aspect is that, on display, the operands are reordered to some >> standard order, but on comparison, the operator order matters. >> >> n [3]: Add(3,2,evaluate=False) >> Out[3]: 2 + 3 >> >> In [4]: Add(2,3,evaluate=False) >> Out[4]: 2 + 3 >> >> In [5]: Add(3,2,evaluate=False) == Add(2,3,evaluate=False) >> Out[5]: False >> >> >> Is it possible to make the comparison use the same scheme as the display? >> It is confusing to get results that 2+3 is not the same as 2+3. >> >> Duane > > -- > 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/5b68d3eb-3432-4b53-8288-2a892dba49b5%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- 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/CAKgW%3D6Ksf9%2BL4_7hdkww-CL6BAseugshU0BUdvH8yzYbuKVFJA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
