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-123560: correct docs for "empty" format type for floats #123561

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

skirpichev
Copy link
Member

@skirpichev skirpichev commented Sep 1, 2024

@skirpichev
Copy link
Member Author

CC @picnixz

FYI, this behaviour was implemented in d3ca557 (mostly it's a fallback code with few lines in format_float_short).

@picnixz
Copy link
Member

picnixz commented Sep 4, 2024

I'll have a look at it tomorrow afternoon or in the week-end. I need to read your issue as well.

@picnixz picnixz self-requested a review September 4, 2024 08:24
@skirpichev skirpichev added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Sep 25, 2024
@skirpichev skirpichev requested a review from picnixz September 25, 2024 15:02
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

I can see differences:

>>> format(1.0, '')  # at least one digit past dot
'1.0'
>>> format(1.0, 'g')
'1'

>>> format(1.2345e10, '')
'12345000000.0'
>>> format(1.2345e10, 'g')
'1.2345e+10'

@vstinner vstinner merged commit 274d9ab into python:main Sep 26, 2024
27 checks passed
@miss-islington-app
Copy link

Thanks @skirpichev for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 26, 2024
@bedevere-app
Copy link

bedevere-app bot commented Sep 26, 2024

GH-124596 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 26, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 26, 2024
@bedevere-app
Copy link

bedevere-app bot commented Sep 26, 2024

GH-124597 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Sep 26, 2024
@vstinner
Copy link
Member

Merged. Thanks @skirpichev and @picnixz.

vstinner pushed a commit that referenced this pull request Sep 26, 2024
…-123561) (#124597)

gh-123560: Correct docs for "empty" format type for floats (GH-123561)
(cherry picked from commit 274d9ab)

Co-authored-by: Sergey B Kirpichev <[email protected]>
@skirpichev skirpichev deleted the fix-empty-format-123560 branch September 26, 2024 13:03
Yhg1s pushed a commit that referenced this pull request Sep 26, 2024
…-123561) (#124596)

gh-123560: Correct docs for "empty" format type for floats (GH-123561)
(cherry picked from commit 274d9ab)

Co-authored-by: Sergey B Kirpichev <[email protected]>
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 skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants