Skip to content
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

Merged
merged 4 commits into from
Mar 29, 2017
Merged

bpo-29677: DOC: clarify documentation for round #877

merged 4 commits into from
Mar 29, 2017

Conversation

csabella
Copy link
Contributor

Changed the parameter name fromnumber 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.

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`
@the-knights-who-say-ni
Copy link

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!

@mention-bot
Copy link

@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.

@Mariatta Mariatta added needs backport to 3.5 docs Documentation in the Doc dir labels Mar 28, 2017
@@ -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])
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thank you.

@Mariatta Mariatta merged commit 85deefc into python:master Mar 29, 2017
@Mariatta
Copy link
Member

@csabella, thanks for your first contribution to CPython! 🎉
I will backport it into 3.5 and 3.6 later today.

@csabella
Copy link
Contributor Author

Thank you, Mariatta. This is so exciting!

Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Mar 30, 2017
Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Mar 30, 2017
Mariatta added a commit that referenced this pull request Mar 30, 2017
Mariatta added a commit that referenced this pull request Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants