I have to admit I have no clue about the details of this debate any more, and I'm cowardly awaiting a patch submission that Tim approves of. (I'm hoping a day will come when Tim can check it in himself. :-) In the mean time, I'd like to emphasize the key invariant here: we must ensure that (a==b) => (hash(a)==hash(b)). One quick way to deal with this could be the following pseudo C: PyObject *double_hash(double x) { long l = (long)x; if ((double)l == x) return long_hash(l); ...double-specific code... } This code makes one assumption: that if there exists a long l equal to a double x, the cast (long)x should yield l... --Guido van Rossum (home page: http://www.python.org/~guido/)
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