Skip to content

Conversation

@1nftf
Copy link
Contributor

@1nftf 1nftf commented Nov 29, 2025

@python-cla-bot
Copy link

python-cla-bot bot commented Nov 29, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@skirpichev skirpichev self-requested a review December 5, 2025 13:43
Copy link
Contributor Author

@1nftf 1nftf left a comment

Choose a reason for hiding this comment

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

The float.__format__ method internally calls PyOS_double_to_string.

The default PyOS_double_to_string implementation will pad the exponent to 2 digits and use a zero exponent for a zero value.

exp_len = sprintf(p, "%+.02d", exp);

The fallback PyOS_double_to_string implementation will internally call PyOS_snprintf.
This also pad the exponent to 2 digits and use a zero exponent for a zero value.

PyOS_snprintf(buffer, buf_size, format, d);

@skirpichev skirpichev added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Dec 11, 2025
@hugovk hugovk merged commit e27f76b into python:main Dec 16, 2025
36 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Dec 16, 2025
@miss-islington-app
Copy link

Thanks @1nftf for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 16, 2025
…ed with presentation type 'e' (pythonGH-142084)

(cherry picked from commit e27f76b)

Co-authored-by: 1nftf <QfxZ11@proton.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 16, 2025
…ed with presentation type 'e' (pythonGH-142084)

(cherry picked from commit e27f76b)

Co-authored-by: 1nftf <QfxZ11@proton.me>
@bedevere-app
Copy link

bedevere-app bot commented Dec 16, 2025

GH-142813 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 16, 2025
@bedevere-app
Copy link

bedevere-app bot commented Dec 16, 2025

GH-142814 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 Dec 16, 2025
hugovk pushed a commit that referenced this pull request Dec 16, 2025
…ted with presentation type 'e' (GH-142084) (#142813)

Co-authored-by: 1nftf <QfxZ11@proton.me>
hugovk pushed a commit that referenced this pull request Dec 16, 2025
…ted with presentation type 'e' (GH-142084) (#142814)

Co-authored-by: 1nftf <QfxZ11@proton.me>
@1nftf 1nftf deleted the gh-142019 branch December 19, 2025 11:07
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

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants