[issue8188] Unified hash for numeric types.
Mark Dickinson
report at bugs.python.org
Sat May 22 12:14:51 CEST 2010
Mark Dickinson <dickinsm at gmail.com> added the comment:
Updated patch:
- make hash(m/P) preserve sign, as discussed earlier
- add details for computing the hash of a complex number
- reorganize sys.hash_info
- drop sys.hash_info.bits (the exponent of the Mersenne prime);
it's not needed in the Python code, and it can be deduced from
the prime itself if necessary. This also means that there's no
public requirement that the prime be a Mersenne prime.
- drop sys.hash_info.ninf; just use -sys.hash_info.inf instead
- add sys.hash_info.width: the underlying width in bits for hashes
of all descriptions; in other words, it's just the number of bits
in a C long in the current implementation
- add sys.hash_info.imag, the multiplier used for the imaginary
part of a complex number
----------
Added file: http://bugs.python.org/file17437/numeric_hash8.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8188>
_______________________________________
More information about the Python-bugs-list
mailing list