akira added the comment:
Is the issue that:
>>> (1, float('nan')) == (1, float('nan'))
False
but
>>> nan = float('nan')
>>> (1, nan) == (1, nan)
True
?
`nan != nan` therefore it might be expected that `(a, nan) != (a, nan)` [1]:
> The values float('NaN') and Decimal('NaN') are special. The are identical to
> themselves, x is x but are not equal to themselves, x != x.
> Tuples and lists are compared lexicographically using comparison of
> corresponding elements. This means that to compare equal, each element must
> compare equal and the two sequences must be of the same type and have the
> same length.
> If not equal, the sequences are ordered the same as their first differing
> elements.
[1]: https://docs.python.org/3.4/reference/expressions.html#comparisons
----------
nosy: +akira
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21873>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com