Skip to content

gh-123560: correct docs for "empty" format type for floats#123561

Merged
vstinner merged 2 commits into
python:mainfrom
skirpichev:fix-empty-format-123560
Sep 26, 2024
Merged

gh-123560: correct docs for "empty" format type for floats#123561
vstinner merged 2 commits into
python:mainfrom
skirpichev:fix-empty-format-123560

Conversation

@skirpichev

@skirpichev skirpichev commented Sep 1, 2024

Copy link
Copy Markdown
Member

@skirpichev

Copy link
Copy Markdown
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

picnixz commented Sep 4, 2024

Copy link
Copy Markdown
Member

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 only security fixes needs backport to 3.13 bugs and security fixes labels Sep 25, 2024
Comment thread Doc/library/string.rst Outdated
@skirpichev skirpichev requested a review from picnixz September 25, 2024 15:02

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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
@miss-islington-app

Copy link
Copy Markdown

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

bedevere-app Bot commented Sep 26, 2024

Copy link
Copy Markdown

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

bedevere-app Bot commented Sep 26, 2024

Copy link
Copy Markdown

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 only security fixes label Sep 26, 2024
@vstinner

Copy link
Copy Markdown
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