Uh oh!
There was an error while loading. Please reload this page.
bpo-30940: fix docs for round if second arg is None - #2824
Conversation
mention-bot
commented
Jul 23, 2017
@daxlab, thanks for your PR! By analyzing the history of the files in this pull request, we identified @birkenfeld, @benjaminp and @rhettinger to be potential reviewers. |
| ``2``). Any integer value is valid for *ndigits* (positive, zero, or | ||
| negative). The return value is an integer if called with one argument, | ||
| otherwise of the same type as *number*. | ||
| negative). The return value is an integer if *ndigits* is omitted or *None*. |
There was a problem hiding this comment.
Format None with fixed-width font instead of italic.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Needed to update the docstring too.
The signature of the function can be written as
round(number, ndigits=None)
mdickinson
left a comment
There was a problem hiding this comment.
LGTM. Thanks for doing this!
Please update the docstring. And what is more correct, (as in the first paragraph), or (as in the second paragraph)? Or both are correct? |
daxlab
commented
Jul 23, 2017
|
| "round(number, ndigits=None) -> number\n\ | ||
| \n\ | ||
| Round a number to a given precision in decimal digits (default 0 digits).\n\ | ||
| This returns an int when called with one argument, otherwise the\n\ |
There was a problem hiding this comment.
"if ndigits is omitted or None"
mdickinson
commented
Jul 23, 2017
About
versus
I think either is fine. To my eyes, the first looks a bit clearer, but also a bit more pedantic. |
daxlab
commented
Jul 24, 2017
@serhiy-storchaka docs updated. |
@serhiy-storchaka plz review. Also, should I send a separate PR to 3.6 branch or you can cherry-pick ? |
serhiy-storchaka
commented
Aug 27, 2017
The current changes LGTM, but see a discussion on the tracker. Perhaps the documentation needs additional clarification. |
https://bugs.python.org/issue30940