mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Manual forward port of 64962 - use PyObject_HashNotImplemented as a tp_hash level indicator that the default hash implementation has not been inherited
This commit is contained in:
parent
e65282114e
commit
d1abd25ed8
12 changed files with 122 additions and 94 deletions
|
@ -608,13 +608,6 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long
|
||||
deque_nohash(PyObject *self)
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "deque objects are unhashable");
|
||||
return -1;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
deque_copy(PyObject *deque)
|
||||
{
|
||||
|
@ -858,7 +851,7 @@ static PyTypeObject deque_type = {
|
|||
0, /* tp_as_number */
|
||||
&deque_as_sequence, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
deque_nohash, /* tp_hash */
|
||||
(hashfunc)PyObject_HashNotImplemented, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
PyObject_GenericGetAttr, /* tp_getattro */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue