From f25f2e2e8c8e48490d22b0cdf67f575608701f6f Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 19 Sep 2021 18:05:30 +0300 Subject: Clean up initialization __class_getitem__ with Py_GenericAlias. (GH-28450) The cast to PyCFunction is redundant. Overuse of redundant casts can hide actual bugs. --- Modules/_functoolsmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/_functoolsmodule.c') diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index a93c0be6a1..d6dfefdd87 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -465,7 +465,7 @@ partial_setstate(partialobject *pto, PyObject *state) static PyMethodDef partial_methods[] = { {"__reduce__", (PyCFunction)partial_reduce, METH_NOARGS}, {"__setstate__", (PyCFunction)partial_setstate, METH_O}, - {"__class_getitem__", (PyCFunction)Py_GenericAlias, + {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; -- cgit v1.2.1