STINNER Victor added the comment:
I never understood how container comparison works.
>>> nan = float("nan")
>>> [nan] == [nan]
True
>>> (nan,) == (nan,)
True
>>> nan == nan
False
>>> nan is nan
True
I picked the float NaN because it's one of the weirdest object in Python: it's
not equal to itself.
I don't know what is the impact of the proposed change on comparison. Can it
break an application? It's unclear to me.
--
It also recalls me an optimization I proposed on string: begin with comparison
on the hash, if the two hashs are already known. At the end, we decided that it
wasn't worth it.
--
Raymond, Tim and Serhiy don't seem to be convince, so I will follow them and
agree to reject this optimization :-)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30907>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com