Message101581
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. |
|
Date |
User |
Action |
Args |
2010-03-23 14:01:35 | mark.dickinson | set | recipients:
+ mark.dickinson, Rhamphoryncus, eric.smith |
2010-03-23 14:01:34 | mark.dickinson | set | messageid: <1269352894.63.0.0508863940352.issue8188@psf.upfronthosting.co.za> |
2010-03-23 14:01:33 | mark.dickinson | link | issue8188 messages |
2010-03-23 14:01:31 | mark.dickinson | create | |
|