Mark Dickinson <dicki...@gmail.com> added the comment: Another update, partly to address comments raised by Guido on Rietveld. I'll upload these changes to Rietveld later today.
- rename sys._hash_info to sys.hash_info and make it public rather than private (it still needs docs somewhere) - add some explanatory comments to long_hash; remove an outdated comment - fix missing error check (in previous patch) in slot_tp_hash. slot_tp_hash also now always raises a TypeError if __hash__ returns a non-integer; this is a change from current behaviour, which allows small floats to be returned by __hash__, but not large floats (where large means > 2**31 or > 2**63 in absolute value, depending on the system). I'm assuming this was unintentional (the docs specify that __hash__ should return an integer). - simplify specification of hash function slightly: for nonnegative x it simply computes the reduction of x; previously it computed 1 + reduction of (x-1) for positive values. This extra +-1 doesn't really add anything of value, and makes it slightly more complicated and error-prone to write your own hash function. ---------- Added file: http://bugs.python.org/file16629/numeric_hash4.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8188> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com