-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-29677: DOC: clarify documentation for round
#877
Conversation
Changed the parameter name from 'number' to 'x' to be consistent with documentation for other numeric functions, such as abs, float, math.floor, and mail.ceil. The use of 'number' seemed to indicate an object from the Number class, which with PEP 3141 was not valid for round since round is implemented for Real and not Complex. Not sure about this one, but changed the phrase '*ndigits* digits' to be "*ndigits* precision' to match the help() text. Moved the delegation line and expanded it to match the similar line in the float() section since that is the only other built-in over the Real class.
bpo-29677: DOC: clarify documentation for `round`
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
@csabella, 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. |
Doc/library/functions.rst
Outdated
@@ -1252,19 +1252,22 @@ are always available. They are listed here in alphabetical order. | |||
arguments starting at ``0``). | |||
|
|||
|
|||
.. function:: round(number[, ndigits]) | |||
.. function:: round(x[, ndigits]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> round(x=4)
TypeError: Required argument 'number' (pos 1) not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you.
@csabella, thanks for your first contribution to CPython! 🎉 |
Thank you, Mariatta. This is so exciting! |
(cherry picked from commit 85deefc)
(cherry picked from commit 85deefc)
Changed the parameter name from
number
tox
to be consistent with documentation for other numeric functions, such as abs, float, math.floor, and mail.ceil. The use of number seemed to indicate an object from the Number class, which with PEP 3141 was not valid for round since round is implemented for Real and not Complex.Not sure about this one, but changed the phrase
*ndigits* digits
to be*ndigits* precision
to match the help() text.Moved the delegation line and expanded it to match the similar line in the
float()
section since that is the only other built-in over the Real class.