Message 106291 - Python tracker (original) (raw)
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