[issue21873] Tuple comparisons with NaNs are broken
Mak Nazečić-Andrlon
report at bugs.python.org
Fri Jun 27 03:05:14 CEST 2014
Mak Nazečić-Andrlon added the comment:
It's not about equality.
>>> class A: pass
...
>>> (float("nan"), A()) < (float("nan"), A())
False
That < comparison should throw a TypeError, since NaN < NaN is False, in the same way that 0 < 0 is False here:
>>> (0, A()) < (0, A())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unorderable types: A() < A()
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21873>
_______________________________________
More information about the Python-bugs-list
mailing list