summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/mathmodule.c.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-25 11:23:47 (GMT)
committerGitHub <noreply@github.com>2018-12-25 11:23:47 (GMT)
commit32d96a2b5bc3136d45a66adbdb45fac351b520ce (patch)
treeacf51c9945f764ab103597c9cba376f154aa600d /Modules/clinic/mathmodule.c.h
parent65ce60aef150776f884715b4315a10a0d6ae769e (diff)
downloadcpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.zip
cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.gz
cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.bz2
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
Diffstat (limited to 'Modules/clinic/mathmodule.c.h')
-rw-r--r--Modules/clinic/mathmodule.c.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h
index c8d8029..e436f59 100644
--- a/Modules/clinic/mathmodule.c.h
+++ b/Modules/clinic/mathmodule.c.h
@@ -108,7 +108,8 @@ math_frexp(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:frexp", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_frexp_impl(module, x);
@@ -168,7 +169,8 @@ math_modf(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:modf", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_modf_impl(module, x);
@@ -352,7 +354,8 @@ math_degrees(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:degrees", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_degrees_impl(module, x);
@@ -379,7 +382,8 @@ math_radians(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:radians", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_radians_impl(module, x);
@@ -406,7 +410,8 @@ math_isfinite(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:isfinite", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_isfinite_impl(module, x);
@@ -433,7 +438,8 @@ math_isnan(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:isnan", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_isnan_impl(module, x);
@@ -460,7 +466,8 @@ math_isinf(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
double x;
- if (!PyArg_Parse(arg, "d:isinf", &x)) {
+ x = PyFloat_AsDouble(arg);
+ if (PyErr_Occurred()) {
goto exit;
}
return_value = math_isinf_impl(module, x);
@@ -523,4 +530,4 @@ math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
-/*[clinic end generated code: output=8b1709a71e5fb855 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=da4b9940a5cb0188 input=a9049054013a1b77]*/