summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/mathmodule.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/clinic/mathmodule.c.h')
-rw-r--r--Modules/clinic/mathmodule.c.h49
1 files changed, 42 insertions, 7 deletions
diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h
index b99a8de..1806a01 100644
--- a/Modules/clinic/mathmodule.c.h
+++ b/Modules/clinic/mathmodule.c.h
@@ -536,17 +536,44 @@ math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL};
- static _PyArg_Parser _parser = {"dd|$dd:isclose", _keywords, 0};
+ static _PyArg_Parser _parser = {NULL, _keywords, "isclose", 0};
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
double a;
double b;
double rel_tol = 1e-09;
double abs_tol = 0.0;
int _return_value;
- if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
- &a, &b, &rel_tol, &abs_tol)) {
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
goto exit;
}
+ a = PyFloat_AsDouble(args[0]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ b = PyFloat_AsDouble(args[1]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ rel_tol = PyFloat_AsDouble(args[2]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ abs_tol = PyFloat_AsDouble(args[3]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_kwonly:
_return_value = math_isclose_impl(module, a, b, rel_tol, abs_tol);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -580,17 +607,25 @@ math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"", "start", NULL};
- static _PyArg_Parser _parser = {"O|$O:prod", _keywords, 0};
+ static _PyArg_Parser _parser = {NULL, _keywords, "prod", 0};
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
PyObject *iterable;
PyObject *start = NULL;
- if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
- &iterable, &start)) {
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
goto exit;
}
+ iterable = args[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ start = args[1];
+skip_optional_kwonly:
return_value = math_prod_impl(module, iterable, start);
exit:
return return_value;
}
-/*[clinic end generated code: output=20505690ca6fe402 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=96e71135dce41c48 input=a9049054013a1b77]*/