Message221603
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 |
|
Date |
User |
Action |
Args |
2014-06-26 14:42:04 | akira | set | recipients:
+ akira, mark.dickinson, Electro |
2014-06-26 14:42:04 | akira | set | messageid: <1403793724.85.0.216847046716.issue21873@psf.upfronthosting.co.za> |
2014-06-26 14:42:04 | akira | link | issue21873 messages |
2014-06-26 14:42:04 | akira | create | |
|