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

Martin v. Löwis report at bugs.python.org
Mon Oct 18 22:46:26 CEST 2010


Martin v. Löwis <martin at v.loewis.de> added the comment:

> Wouldn't it be cleaner if x was the same type as hash?  Note that
> unsigned long is now wrong.  What is needed is "unsigned integer type
> of the same size as Py_hash_t."  If Py_hash_t has to stay signed, I
> think we should at least not rely of sizeof(Py_hash_t) to always
> remain the same as sizeof(size_t).

But this is an absolute requirement, a guarantee that we provide
forever, and the whole point of this patch. Py_hash_t *will* be
a signed version of size_t, just as Py_ssize_t. Not by chance, but
by careful, inherent design.

----------

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


More information about the Python-bugs-list mailing list