diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 00:35:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 00:35:17 (GMT) |
commit | 259f0e4437ed30036578aba822560feb531b7735 (patch) | |
tree | 2ed9ead4992b791c76e1d52e0db3d1cd0516ec11 /Python | |
parent | 0c8c3893ae29fab8ce9db0c2f5b52acbe89032e1 (diff) | |
download | cpython-259f0e4437ed30036578aba822560feb531b7735.zip cpython-259f0e4437ed30036578aba822560feb531b7735.tar.gz cpython-259f0e4437ed30036578aba822560feb531b7735.tar.bz2 |
Run Argument Clinic: METH_VARARGS=>METH_FASTCALL
Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling
convention for functions using only positional arguments.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/clinic/_warnings.c.h | 2 | ||||
-rw-r--r-- | Python/clinic/bltinmodule.c.h | 12 | ||||
-rw-r--r-- | Python/clinic/import.c.h | 12 |
3 files changed, 17 insertions, 9 deletions
diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index c15c9be..550c73f 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -35,4 +35,4 @@ warnings_warn(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn exit: return return_value; } -/*[clinic end generated code: output=b3c5297c2c55778c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=acadf1788059034c input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 8d429e2..abf45b8 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -80,22 +80,26 @@ PyDoc_STRVAR(builtin_format__doc__, "format_spec defaults to the empty string"); #define BUILTIN_FORMAT_METHODDEF \ - {"format", (PyCFunction)builtin_format, METH_VARARGS, builtin_format__doc__}, + {"format", (PyCFunction)builtin_format, METH_FASTCALL, builtin_format__doc__}, static PyObject * builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec); static PyObject * -builtin_format(PyObject *module, PyObject *args) +builtin_format(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *value; PyObject *format_spec = NULL; - if (!PyArg_ParseTuple(args, "O|U:format", + if (!_PyArg_ParseStack(args, nargs, "O|U:format", &value, &format_spec)) { goto exit; } + + if (!_PyArg_NoStackKeywords("format", kwnames)) { + goto exit; + } return_value = builtin_format_impl(module, value, format_spec); exit: @@ -674,4 +678,4 @@ builtin_issubclass(PyObject *module, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=63483deb75805f7c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=66818a69d6d23181 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index b3460b0..6ee9120 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -75,23 +75,27 @@ PyDoc_STRVAR(_imp__fix_co_filename__doc__, " File path to use."); #define _IMP__FIX_CO_FILENAME_METHODDEF \ - {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, _imp__fix_co_filename__doc__}, + {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, static PyObject * _imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code, PyObject *path); static PyObject * -_imp__fix_co_filename(PyObject *module, PyObject *args) +_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyCodeObject *code; PyObject *path; - if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename", + if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename", &PyCode_Type, &code, &path)) { goto exit; } + + if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) { + goto exit; + } return_value = _imp__fix_co_filename_impl(module, code, path); exit: @@ -361,4 +365,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5a3f012344950548 input=a9049054013a1b77]*/ |