-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Issue: python/cpython#113024
PR: python/cpython#113025
Py_hash_t PyObject_GenericHash(PyObject *obj)
It is the implementation of the default Python object hashing function object.__hash__()
. In CPython it is identical to Py_HashPointer()
, but has the signature compatible with tp_hash
. It can only be used for Python objects, not arbitrary pointers, and it is more portable. It can be used in implementations that have no equivalence between object identity and object address.
PyObject_GenericHash()
should be used for calculating the hash of Python object. Py_HashPointer()
should be used for pointers not managed by Python object manger (i.e. static data, malloced data or pointers to C functions like wrapperobject.descr
).
- @gvanrossum
- @encukou (prefers rename)
- @vstinner (+1)
- @zooba (prefers Petr's rename)
- @iritkatriel
Metadata
Metadata
Assignees
Labels
No labels