mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-113024: C API: Add PyObject_GenericHash() function (GH-113025)
This commit is contained in:
parent
567ab3bd15
commit
e2e0b4b4b9
14 changed files with 51 additions and 13 deletions
|
@ -94,7 +94,7 @@ _Py_HashDouble(PyObject *inst, double v)
|
|||
if (Py_IS_INFINITY(v))
|
||||
return v > 0 ? _PyHASH_INF : -_PyHASH_INF;
|
||||
else
|
||||
return _Py_HashPointer(inst);
|
||||
return PyObject_GenericHash(inst);
|
||||
}
|
||||
|
||||
m = frexp(v, &e);
|
||||
|
@ -139,6 +139,12 @@ Py_HashPointer(const void *ptr)
|
|||
return hash;
|
||||
}
|
||||
|
||||
Py_hash_t
|
||||
PyObject_GenericHash(PyObject *obj)
|
||||
{
|
||||
return Py_HashPointer(obj);
|
||||
}
|
||||
|
||||
Py_hash_t
|
||||
_Py_HashBytes(const void *src, Py_ssize_t len)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue