diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-15 14:27:37 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-15 14:27:37 (GMT) |
commit | 53663a695ef2bb96ac0252cd4cc4aa40d4f953be (patch) | |
tree | e241ef71b353f8b3162179b1eed5a3f4eaae0c5f /Modules/_collectionsmodule.c | |
parent | 9ace15ca25e1e72e1b943190a5f4efbd7d118de3 (diff) | |
download | cpython-53663a695ef2bb96ac0252cd4cc4aa40d4f953be.zip cpython-53663a695ef2bb96ac0252cd4cc4aa40d4f953be.tar.gz cpython-53663a695ef2bb96ac0252cd4cc4aa40d4f953be.tar.bz2 |
Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful
Diffstat (limited to 'Modules/_collectionsmodule.c')
-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 4d13e45..18a72f9 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) { @@ -917,7 +910,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 */ |