[Python-checkins] cpython: type_prepare() now uses fast call (METH_FASTCALL)

victor.stinner python-checkins at python.org
Mon Jan 16 17:57:59 EST 2017


https://hg.python.org/cpython/rev/4e67dce9721b
changeset:   106172:4e67dce9721b
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Jan 16 23:52:00 2017 +0100
summary:
  type_prepare() now uses fast call (METH_FASTCALL)

files:
  Objects/typeobject.c |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3112,7 +3112,8 @@
 }
 
 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 @@
     {"__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,

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list