summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-09-14 10:31:50 (GMT)
committerGitHub <noreply@github.com>2019-09-14 10:31:50 (GMT)
commitd322abbb83eb751045246a70f39d040d13a6108b (patch)
tree40ecc91950b369af1aaaebdd677c071aeae72d53 /Python/bltinmodule.c
parent66da347ef0034ad9bddc7fad112025c886249f0d (diff)
downloadcpython-d322abbb83eb751045246a70f39d040d13a6108b.zip
cpython-d322abbb83eb751045246a70f39d040d13a6108b.tar.gz
cpython-d322abbb83eb751045246a70f39d040d13a6108b.tar.bz2
[3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141)
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all. (cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 8f9e813..c8d34c9 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2147,7 +2147,7 @@ builtin_repr(PyObject *module, PyObject *obj)
round as builtin_round
number: object
- ndigits: object = NULL
+ ndigits: object = None
Round a number to a given precision in decimal digits.
@@ -2157,7 +2157,7 @@ the return value has the same type as the number. ndigits may be negative.
static PyObject *
builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits)
-/*[clinic end generated code: output=ff0d9dd176c02ede input=854bc3a217530c3d]*/
+/*[clinic end generated code: output=ff0d9dd176c02ede input=275678471d7aca15]*/
{
PyObject *round, *result;
@@ -2175,7 +2175,7 @@ builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits)
return NULL;
}
- if (ndigits == NULL || ndigits == Py_None)
+ if (ndigits == Py_None)
result = _PyObject_CallNoArg(round);
else
result = PyObject_CallFunctionObjArgs(round, ndigits, NULL);