Michael Hudson wrote: > >>> float('nan') > nan > >>> _ == _ > False This means that 'nan' is no longer a well-behaved dictionary key: >>> x = {float('nan'):0} >>> x[float('nan')] = 1 >>> print x {nan: 0, nan: 1} Even worse, we get different behavior if we use the "same copy" of nan: >>> nan = float('nan') >>> x = {nan:0} >>> x[nan] = 1 >>> print x {nan: 1} If we *really* want nan==nan to be false, then it seems like we have to say that nan is unhashable. I'm also disturbed by the fact that cmp() has something different to say about their equality: >>> cmp(float('nan'), float('nan')) 0 -Edward
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4