type_prepare() now uses fast call (METH_FASTCALL)

This commit is contained in:
Victor Stinner 2017-01-16 23:52:00 +01:00
parent 80ab22fa2c
commit d526cfe546
1 changed files with 3 additions and 2 deletions

View File

@ -3112,7 +3112,8 @@ type_subclasses(PyTypeObject *type, PyObject *args_ignored)
}
static PyObject *
type_prepare(PyObject *self, PyObject *args, PyObject *kwds)
type_prepare(PyObject *self, PyObject **args, Py_ssize_t nargs,
PyObject *kwnames)
{
return PyDict_New();
}
@ -3216,7 +3217,7 @@ static PyMethodDef type_methods[] = {
{"__subclasses__", (PyCFunction)type_subclasses, METH_NOARGS,
PyDoc_STR("__subclasses__() -> list of immediate subclasses")},
{"__prepare__", (PyCFunction)type_prepare,
METH_VARARGS | METH_KEYWORDS | METH_CLASS,
METH_FASTCALL | METH_CLASS,
PyDoc_STR("__prepare__() -> dict\n"
"used to create the namespace for the class statement")},
{"__instancecheck__", type___instancecheck__, METH_O,