Author mark.dickinson
Recipients belopolsky, benjamin.peterson, casevh, georg.brandl, jimjjewett, ked-tao, lemburg, loewis, mark.dickinson, pitrou, rhettinger, skip.montanaro, tim.peters
Date 2010-10-19.07:15:04
SpamBayes Score 1.92933e-07
Marked as misclassified No
Message-id <1287472507.12.0.377304464383.issue9778@psf.upfronthosting.co.za>
In-reply-to
Content
> The calculation of long_hash assumes an unsigned temporary type to get
> correct results for the bit shifting and masking.

Yes, exactly.

> The calculation is
> done on the absolute value of the long and then the sign is applied. We
> either needed to (1) add an unsigned Py_hash_t type or (2) just use
> size_t and Py_ssize_t.

I like (2);  the use of Py_hash_t suggests to me that the type used for the hash is configurable independently of Py_ssize_t, which isn't true.

Also, with Py_hash_t it's no longer clear that printing a hash value (e.g., using PyErr_Format and friends) should use the '%zd' modifier.
History
Date User Action Args
2010-10-19 07:15:07mark.dickinsonsetrecipients: + mark.dickinson, lemburg, tim.peters, loewis, skip.montanaro, georg.brandl, rhettinger, jimjjewett, belopolsky, pitrou, casevh, ked-tao, benjamin.peterson
2010-10-19 07:15:07mark.dickinsonsetmessageid: <1287472507.12.0.377304464383.issue9778@psf.upfronthosting.co.za>
2010-10-19 07:15:04mark.dickinsonlinkissue9778 messages
2010-10-19 07:15:04mark.dickinsoncreate