[docs] [issue11945] Adopt and document consistent semantics for handling NaN values in containers
report at bugs.python.org
Thu Apr 28 07:32:54 CEST 2011
Glenn Linderman <v+python at g.nevcal.com> added the comment:
Bertrand Meyer's exposition is flowery, and he is a learned man, but the basic argument he makes is:
Reflexivity of equality is something that we expect for any data type, and it seems hard to justify that a value is not equal to itself. As to assignment, what good can it be if it does not make the target equal to the source value?
The argument is flawed: now that NaN exists, and is not equal to itself in value, there should be, and need be, no expectation that assignment elsewhere should make the target equal to the source in value. It can, and in Python, should, make them match in identity (is) but not in value (==, equality).
I laud the idea of adding to definition of reflexive equality to the glossary. However, I think it is presently a bug that a list containing a NaN value compares equal to itself. Yes, such a list should have the same identity (is), but should not be equal.
Python tracker <report at bugs.python.org>
More information about the docs