From 271403abe36069797ac332e1c6eae3473878db20 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 17 Jan 2017 01:29:01 +0100 Subject: Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywords Issue #29286. --- Modules/clinic/cmathmodule.c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/clinic/cmathmodule.c.h') diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 05431fa7af..3955a27e9a 100644 --- a/Modules/clinic/cmathmodule.c.h +++ b/Modules/clinic/cmathmodule.c.h @@ -869,7 +869,7 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn double abs_tol = 0.0; int _return_value; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &a, &b, &rel_tol, &abs_tol)) { goto exit; } -- cgit v1.2.1 From 7372e18fa83aa35766f8f6fdf3aed27fac2d52d2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 17 Jan 2017 01:35:17 +0100 Subject: 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. --- Modules/clinic/cmathmodule.c.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'Modules/clinic/cmathmodule.c.h') diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 3955a27e9a..b7a37270df 100644 --- a/Modules/clinic/cmathmodule.c.h +++ b/Modules/clinic/cmathmodule.c.h @@ -641,22 +641,26 @@ PyDoc_STRVAR(cmath_log__doc__, "If the base not specified, returns the natural logarithm (base e) of z."); #define CMATH_LOG_METHODDEF \ - {"log", (PyCFunction)cmath_log, METH_VARARGS, cmath_log__doc__}, + {"log", (PyCFunction)cmath_log, METH_FASTCALL, cmath_log__doc__}, static PyObject * cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj); static PyObject * -cmath_log(PyObject *module, PyObject *args) +cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_complex x; PyObject *y_obj = NULL; - if (!PyArg_ParseTuple(args, "D|O:log", + if (!_PyArg_ParseStack(args, nargs, "D|O:log", &x, &y_obj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("log", kwnames)) { + goto exit; + } return_value = cmath_log_impl(module, x, y_obj); exit: @@ -726,22 +730,26 @@ PyDoc_STRVAR(cmath_rect__doc__, "Convert from polar coordinates to rectangular coordinates."); #define CMATH_RECT_METHODDEF \ - {"rect", (PyCFunction)cmath_rect, METH_VARARGS, cmath_rect__doc__}, + {"rect", (PyCFunction)cmath_rect, METH_FASTCALL, cmath_rect__doc__}, static PyObject * cmath_rect_impl(PyObject *module, double r, double phi); static PyObject * -cmath_rect(PyObject *module, PyObject *args) +cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; double r; double phi; - if (!PyArg_ParseTuple(args, "dd:rect", + if (!_PyArg_ParseStack(args, nargs, "dd:rect", &r, &phi)) { goto exit; } + + if (!_PyArg_NoStackKeywords("rect", kwnames)) { + goto exit; + } return_value = cmath_rect_impl(module, r, phi); exit: @@ -882,4 +890,4 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn exit: return return_value; } -/*[clinic end generated code: output=978f59702b41655f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=93eff5d4c242ee57 input=a9049054013a1b77]*/ -- cgit v1.2.1