Mercurial > cpython-lru_cache-weakref
diff Modules/_collectionsmodule.c @ 48475:f4e7ef4329a9
Manual forward port of 64962 - use PyObject_HashNotImplemented as a tp_hash level indicator that the default hash implementation has not been inherited
| author | Nick Coghlan <ncoghlan@gmail.com> |
|---|---|
| date | Tue, 15 Jul 2008 15:46:38 +0000 |
| parents | b5e02775fffc |
| children | 35b1a20470db |
line wrap: on
line diff
--- a/Modules/_collectionsmodule.c Tue Jul 15 15:32:09 2008 +0000 +++ b/Modules/_collectionsmodule.c Tue Jul 15 15:46:38 2008 +0000 @@ -608,13 +608,6 @@ 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 @@ 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 */
