[Python-Dev] Python semantic: Is it ok to replace not x == y with x != y? (no)

Adam Bartoš drekin at gmail.com
Tue Dec 15 09:01:57 EST 2015


Hello,

the comparisons >=, <=, >, < cannot be optimized this way. Not every order
is a total order. For example, sets a = {1, 2} and b = {2, 3} are
incomparable (in the sense that both a >= b and a <= b is False), and it is
no pathology.

Regards, Adam Bartoš
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20151215/e83face5/attachment.html>


More information about the Python-Dev mailing list