[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

Antoine Pitrou report at bugs.python.org
Mon Oct 18 17:27:28 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> AFAICT, a change from (Py_ssize_t)-1 to (size_t)-1 is less likely to
> break code than a change from -1L to  (Py_ssize_t)-1.  (Assuming a
> sizeof(long) != sizeof(void*) platform.)

That's true.

> The benefit, though is that
> hash computations can be performed natively on the hash values without
> casting to an unrelated type.

I don't understand what you mean by "native" and "unrelated". Signed
integers are not less native than unsigned ones.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9778>
_______________________________________


More information about the Python-bugs-list mailing list