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

gh-94808: Cover handling non-finite numbers from round when ndigits is provided #94860

Merged
merged 1 commit into from Jul 14, 2022

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Jul 14, 2022

This is an interesting corner case.

By default round returns int which can't represent non-finite numbers, so it throws various exceptions.

When ndigits is provided, round returns float, so non-finite numbers can be represented, and they just return what was passed in.

Automerge-Triggered-By: GH:brandtbucher

@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Jul 14, 2022
@mdboom mdboom mentioned this pull request Jul 14, 2022
225 tasks
@brandtbucher brandtbucher added the 🤖 automerge PR will be merged once it's been approved and all CI passed label Jul 14, 2022
Copy link
Member

@brandtbucher brandtbucher left a comment

Interesting indeed!

@brandtbucher brandtbucher merged commit 625ba9b into python:main Jul 14, 2022
12 checks passed
@brandtbucher brandtbucher added needs backport to 3.11 and removed 🤖 automerge PR will be merged once it's been approved and all CI passed labels Jul 14, 2022
@miss-islington
Copy link
Contributor

miss-islington commented Jul 15, 2022

Thanks @mdboom for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒🤖

@bedevere-bot
Copy link

bedevere-bot commented Jul 15, 2022

GH-94882 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 15, 2022
…gits is provided (pythonGH-94860)

(cherry picked from commit 625ba9b)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
miss-islington added a commit that referenced this pull request Jul 15, 2022
…igits is provided (GH-94860) (GH-94882)

(cherry picked from commit 625ba9b)


Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Automerge-Triggered-By: GH:brandtbucher
@miss-islington
Copy link
Contributor

miss-islington commented Aug 8, 2022

Thanks @mdboom for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Aug 8, 2022

Sorry, @mdboom and @brandtbucher, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 625ba9bdff51baddf9d5e156e5facf05fa1003d6 3.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants