mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
SF patch #659536: Use PyArg_UnpackTuple where possible.
Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
This commit is contained in:
parent
f8bcfb13f1
commit
ea3fdf44a2
11 changed files with 41 additions and 41 deletions
|
|
@ -588,7 +588,7 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
classmethod *cm = (classmethod *)self;
|
||||
PyObject *callable;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O:classmethod", &callable))
|
||||
if (!PyArg_UnpackTuple(args, "classmethod", 1, 1, &callable))
|
||||
return -1;
|
||||
Py_INCREF(callable);
|
||||
cm->cm_callable = callable;
|
||||
|
|
@ -720,7 +720,7 @@ sm_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
staticmethod *sm = (staticmethod *)self;
|
||||
PyObject *callable;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O:staticmethod", &callable))
|
||||
if (!PyArg_UnpackTuple(args, "staticmethod", 1, 1, &callable))
|
||||
return -1;
|
||||
Py_INCREF(callable);
|
||||
sm->sm_callable = callable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue