Am 24.03.2015 um 12:28 schrieb Paul Royik:
Maybe this is property of Python, but I'm not aware about it.

expr = 1/(2*sin(x/2 + pi/4)*cos(x/2 + pi/4))
equation = Eq(expr,expr)
equation == True # outputs True
equation is True # outputs False

Why True equation is not True?

In Python, "==" is value equality while "is" is object identity.

The differences are relevant in two ways:
1) "==" may change if you modify an object, "is" never does. This is less relevant for SymPy because SymPy objects usually are not modified. 2) "is" cannot be redefined, "==" can. SymPy's S.true has its "==" redefined so that it compares equal with "==".

Moreover, in IDE in which I'm working, when I write equation != True, it
tells me "this inspection detects equality comparison with a boolean
literal".

It's telling you that writing
  xxx == True
is silly because you can simply write
  xxx

--
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/5511555E.1030506%40durchholz.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to