diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2019-09-14 12:24:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-14 12:24:05 +0300 |
| commit | 279f44678c8b84a183f9eeb85e0b086228154497 (patch) | |
| tree | 9cacd41975bf15ab7a94fc5ba6a2df57f8e02ee5 /Objects/floatobject.c | |
| parent | d057b896f97e6d7447b9bf9246770c41cf205299 (diff) | |
| download | cpython-git-279f44678c8b84a183f9eeb85e0b086228154497.tar.gz | |
bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933)
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.
Diffstat (limited to 'Objects/floatobject.c')
| -rw-r--r-- | Objects/floatobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 20b7f5120b..8c08866d73 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -1042,7 +1042,7 @@ double_round(double x, int ndigits) { /*[clinic input] float.__round__ - ndigits as o_ndigits: object = NULL + ndigits as o_ndigits: object = None / Return the Integral closest to x, rounding half toward even. @@ -1052,13 +1052,13 @@ When an argument is passed, work like built-in round(x, ndigits). static PyObject * float___round___impl(PyObject *self, PyObject *o_ndigits) -/*[clinic end generated code: output=374c36aaa0f13980 input=1ca2316b510293b8]*/ +/*[clinic end generated code: output=374c36aaa0f13980 input=fc0fe25924fbc9ed]*/ { double x, rounded; Py_ssize_t ndigits; x = PyFloat_AsDouble(self); - if (o_ndigits == NULL || o_ndigits == Py_None) { + if (o_ndigits == Py_None) { /* single-argument round or with None ndigits: * round to nearest integer */ rounded = round(x); |
