]> granicus.if.org Git - python/commitdiff
type_prepare() now uses fast call (METH_FASTCALL)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Jan 2017 22:52:00 +0000 (23:52 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Jan 2017 22:52:00 +0000 (23:52 +0100)
Objects/typeobject.c

index 05fc7b88d3f531b148e529d9adf83f51f5edc9d4..a52117721030ad9bd6b047ed2afe9be90a38aabd 100644 (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,