mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
use helper hash unimplemented function
This commit is contained in:
parent
a2e7d9bdc1
commit
23d05c1d98
1 changed files with 1 additions and 8 deletions
|
|
@ -344,13 +344,6 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long
|
|
||||||
slice_hash(PySliceObject *v)
|
|
||||||
{
|
|
||||||
PyErr_SetString(PyExc_TypeError, "unhashable type");
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
|
|
||||||
PyTypeObject PySlice_Type = {
|
PyTypeObject PySlice_Type = {
|
||||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||||
"slice", /* Name of this type */
|
"slice", /* Name of this type */
|
||||||
|
|
@ -365,7 +358,7 @@ PyTypeObject PySlice_Type = {
|
||||||
0, /* tp_as_number */
|
0, /* tp_as_number */
|
||||||
0, /* tp_as_sequence */
|
0, /* tp_as_sequence */
|
||||||
0, /* tp_as_mapping */
|
0, /* tp_as_mapping */
|
||||||
(hashfunc)slice_hash, /* tp_hash */
|
PyObject_HashNotImplemented, /* tp_hash */
|
||||||
0, /* tp_call */
|
0, /* tp_call */
|
||||||
0, /* tp_str */
|
0, /* tp_str */
|
||||||
PyObject_GenericGetAttr, /* tp_getattro */
|
PyObject_GenericGetAttr, /* tp_getattro */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue