Python 3.7 METH_FASTCALL backport (#406)

This commit is contained in:
Gautham 2022-05-13 17:35:12 +05:30 committed by GitHub
parent fec396037a
commit 83b743cf96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 2949 additions and 3356 deletions

View file

@ -648,7 +648,7 @@ static PyObject *
cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj);
static PyObject *
cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
Py_complex x;
@ -658,10 +658,6 @@ cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
&x, &y_obj)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("log", kwnames)) {
goto exit;
}
return_value = cmath_log_impl(module, x, y_obj);
exit:
@ -737,7 +733,7 @@ static PyObject *
cmath_rect_impl(PyObject *module, double r, double phi);
static PyObject *
cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
double r;
@ -747,10 +743,6 @@ cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
&r, &phi)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("rect", kwnames)) {
goto exit;
}
return_value = cmath_rect_impl(module, r, phi);
exit:
@ -860,7 +852,7 @@ PyDoc_STRVAR(cmath_isclose__doc__,
"not close to anything, even itself. inf and -inf are only close to themselves.");
#define CMATH_ISCLOSE_METHODDEF \
{"isclose", (PyCFunction)cmath_isclose, METH_FASTCALL, cmath_isclose__doc__},
{"isclose", (PyCFunction)cmath_isclose, METH_FASTCALL|METH_KEYWORDS, cmath_isclose__doc__},
static int
cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
@ -891,4 +883,4 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
exit:
return return_value;
}
/*[clinic end generated code: output=93eff5d4c242ee57 input=a9049054013a1b77]*/
/*[clinic end generated code: output=51ba28d27d10264e input=a9049054013a1b77]*/