Skip to content

gh-131912: Use different grouping options for the integral and fractional parts #132170

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

Merged
merged 2 commits into from
Apr 7, 2025

Conversation

Prometheus3375
Copy link
Contributor

@Prometheus3375 Prometheus3375 commented Apr 6, 2025

A small addition to #132030 discussed in #132123. There are many examples with _ used as digit group separator, but only one with ,. I changed last two examples with floating-point number to include a comma separator. I believe it is sufficient to show that both options can be used for both integral and fractional parts, as well as the fact that a user can mix them.


📚 Documentation preview 📚

@Prometheus3375
Copy link
Contributor Author

Prometheus3375 commented Apr 6, 2025

It is a bit weird that only in the first example format string is rendered in bold. As if all others are not recognized by the renderer as a valid format.
image

@skirpichev skirpichev added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Apr 7, 2025
@skirpichev
Copy link
Member

It is a bit weird that only in the first example format string is rendered in bold.

Looks as a sphinx bug. @picnixz ?

@Prometheus3375
Copy link
Contributor Author

This one shouldn't be backported as 3.13 and below do not have grouping for fractional part.

@picnixz
Copy link
Member

picnixz commented Apr 7, 2025

Looks as a sphinx bug

That would be a Pygment issue in this case. Sphinx delegates highlighting to pygments.

@picnixz picnixz removed needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Apr 7, 2025
@picnixz picnixz self-requested a review April 7, 2025 11:01
@skirpichev
Copy link
Member

Ah, indeed. Thanks.

The problem might be reported, see pygments/pygments#1340. Though, maybe it's a slightly different one. @Prometheus3375 would you like to investigate it and report to upstream?

@Prometheus3375
Copy link
Contributor Author

Looks to me as the same. I will provide an additional context in that issue.

@skirpichev
Copy link
Member

It might be different just because '_' separators were introduced in formatting mini-language later. Just a guess.

@Prometheus3375
Copy link
Contributor Author

They were introduced quite a while ago, in 3.6. Nethertheless, it is not the only place where highlighting does not occur. The same happens in a couple examples below like date format and nested formatting.

@picnixz picnixz changed the title Update grouping examples gh-131912: Use different grouping options for the integral and fractional parts Apr 7, 2025
@picnixz picnixz merged commit 3169743 into python:main Apr 7, 2025
49 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Apr 7, 2025
@Prometheus3375 Prometheus3375 deleted the grouping-examples branch April 7, 2025 16:50
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
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 issue skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants