Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23d05c1

Browse files
committed
use helper hash unimplemented function
1 parent a2e7d9b commit 23d05c1

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

Objects/sliceobject.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,6 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
344344
return res;
345345
}
346346

347-
static long
348-
slice_hash(PySliceObject *v)
349-
{
350-
PyErr_SetString(PyExc_TypeError, "unhashable type");
351-
return -1L;
352-
}
353-
354347
PyTypeObject PySlice_Type = {
355348
PyVarObject_HEAD_INIT(&PyType_Type, 0)
356349
"slice", /* Name of this type */
@@ -365,7 +358,7 @@ PyTypeObject PySlice_Type = {
365358
0, /* tp_as_number */
366359
0, /* tp_as_sequence */
367360
0, /* tp_as_mapping */
368-
(hashfunc)slice_hash, /* tp_hash */
361+
PyObject_HashNotImplemented, /* tp_hash */
369362
0, /* tp_call */
370363
0, /* tp_str */
371364
PyObject_GenericGetAttr, /* tp_getattro */

0 commit comments

Comments
 (0)