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

Skip to content

Commit d526cfe

Browse files
committed
type_prepare() now uses fast call (METH_FASTCALL)
1 parent 80ab22f commit d526cfe

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Objects/typeobject.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,8 @@ type_subclasses(PyTypeObject *type, PyObject *args_ignored)
31123112
}
31133113

31143114
static PyObject *
3115-
type_prepare(PyObject *self, PyObject *args, PyObject *kwds)
3115+
type_prepare(PyObject *self, PyObject **args, Py_ssize_t nargs,
3116+
PyObject *kwnames)
31163117
{
31173118
return PyDict_New();
31183119
}
@@ -3216,7 +3217,7 @@ static PyMethodDef type_methods[] = {
32163217
{"__subclasses__", (PyCFunction)type_subclasses, METH_NOARGS,
32173218
PyDoc_STR("__subclasses__() -> list of immediate subclasses")},
32183219
{"__prepare__", (PyCFunction)type_prepare,
3219-
METH_VARARGS | METH_KEYWORDS | METH_CLASS,
3220+
METH_FASTCALL | METH_CLASS,
32203221
PyDoc_STR("__prepare__() -> dict\n"
32213222
"used to create the namespace for the class statement")},
32223223
{"__instancecheck__", type___instancecheck__, METH_O,

0 commit comments

Comments
 (0)