]> granicus.if.org Git - python/commitdiff
use helper hash unimplemented function
authorBenjamin Peterson <benjamin@python.org>
Sun, 17 Oct 2010 20:13:05 +0000 (20:13 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 17 Oct 2010 20:13:05 +0000 (20:13 +0000)
Objects/sliceobject.c

index 55fda52987fd788bf2f4fb7063d107ad860fb9c3..b6178914239a7a0de49c5ac13208e488c6c2f1ab 100644 (file)
@@ -344,13 +344,6 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
     return res;
 }
 
-static long
-slice_hash(PySliceObject *v)
-{
-    PyErr_SetString(PyExc_TypeError, "unhashable type");
-    return -1L;
-}
-
 PyTypeObject PySlice_Type = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
     "slice",                    /* Name of this type */
@@ -365,7 +358,7 @@ PyTypeObject PySlice_Type = {
     0,                                          /* tp_as_number */
     0,                                          /* tp_as_sequence */
     0,                                          /* tp_as_mapping */
-    (hashfunc)slice_hash,                       /* tp_hash */
+    PyObject_HashNotImplemented,                /* tp_hash */
     0,                                          /* tp_call */
     0,                                          /* tp_str */
     PyObject_GenericGetAttr,                    /* tp_getattro */