diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-15 15:46:38 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-15 15:46:38 (GMT) |
commit | d1abd25ed8e14a64da21d17ece73c49390b9b083 (patch) | |
tree | 21c0fbf58c0b0a05268ccdf538716f2f75dd5576 /Modules | |
parent | e65282114e96efb9e7eee77c57244943b746f6fe (diff) | |
download | cpython-d1abd25ed8e14a64da21d17ece73c49390b9b083.zip cpython-d1abd25ed8e14a64da21d17ece73c49390b9b083.tar.gz cpython-d1abd25ed8e14a64da21d17ece73c49390b9b083.tar.bz2 |
Manual forward port of 64962 - use PyObject_HashNotImplemented as a tp_hash level indicator that the default hash implementation has not been inherited
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_collectionsmodule.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index db7017d..2327cf5 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -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 */ |