Message119124
> 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. |
|
Date |
User |
Action |
Args |
2010-10-19 07:15:07 | mark.dickinson | set | recipients:
+ mark.dickinson, lemburg, tim.peters, loewis, skip.montanaro, georg.brandl, rhettinger, jimjjewett, belopolsky, pitrou, casevh, ked-tao, benjamin.peterson |
2010-10-19 07:15:07 | mark.dickinson | set | messageid: <1287472507.12.0.377304464383.issue9778@psf.upfronthosting.co.za> |
2010-10-19 07:15:04 | mark.dickinson | link | issue9778 messages |
2010-10-19 07:15:04 | mark.dickinson | create | |
|