[issue4296] Python assumes identity implies equivalence; contradicts NaN

Raymond Hettinger report at bugs.python.org
Wed Nov 12 02:22:06 CET 2008


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

Mark, the patch looks good.  Thanks.  Before committing, please add one
other test that verifies the relationship between "in" in membership
tests and "in" in a for-loop:


for constructor in list, tuple, dict.fromkeys, set, collections.deque:
    container = constructor([float('nan'), 1, None, 'abc'])
    for elem in container :
         self.assert_(elem in container)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4296>
_______________________________________


More information about the Python-bugs-list mailing list