mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int. Fixes #1536021.
This commit is contained in:
parent
209307eb3b
commit
ab2f8f7bd5
5 changed files with 24 additions and 6 deletions
|
|
@ -4559,7 +4559,10 @@ slot_tp_hash(PyObject *self)
|
|||
Py_DECREF(func);
|
||||
if (res == NULL)
|
||||
return -1;
|
||||
h = PyInt_AsLong(res);
|
||||
if (PyLong_Check(res))
|
||||
h = res->ob_type->tp_hash(res);
|
||||
else
|
||||
h = PyInt_AsLong(res);
|
||||
Py_DECREF(res);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue