diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2017-02-09 16:09:03 +0100 |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2017-02-09 16:09:03 +0100 |
commit | 2a1d833d5da7fa7a01a2eef183b0a208ed019427 (patch) | |
tree | 8da3ebb695ae55c69d0a58691403fb13d96a9476 /Modules/clinic/cmathmodule.c.h | |
parent | c6180bb73c8c7c7f9d8ea9816487b710597b6fc1 (diff) | |
parent | bbd3587a29510bd5a318e0a19fc8570c0cd3b622 (diff) | |
download | cpython-2a1d833d5da7fa7a01a2eef183b0a208ed019427.tar.gz |
Merge issue #26355 fix from 3.6
Diffstat (limited to 'Modules/clinic/cmathmodule.c.h')
-rw-r--r-- | Modules/clinic/cmathmodule.c.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 05431fa7af..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: @@ -869,7 +877,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; } @@ -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]*/ |