FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-142927: Tachyon: Comma separate thousands and fix singular/plurals by hugovk · Pull Request #142934 · python/cpython · GitHub

/ cpython Public

gh-142927: Tachyon: Comma separate thousands and fix singular/plurals - #142934

Merged
pablogsal merged 4 commits into
python:mainfrom
hugovk:3.15-tachyon-formatting
Dec 22, 2025
Merged

gh-142927: Tachyon: Comma separate thousands and fix singular/plurals#142934
pablogsal merged 4 commits into
python:mainfrom
hugovk:3.15-tachyon-formatting

Conversation

hugovk commented Dec 18, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member
Thing Before After
Console
Captured 4497 samples in 0.45 seconds
Sample rate: 10000.01 samples/sec
Error rate: 13.74%
Heatmap output written to heatmap_69830/
- Index: heatmap_69830/index.html
- 93 source file(s) analyzed
Captured 4,411 samples in 0.44 seconds
Sample rate: 10,000.01 samples/sec
Error rate: 20.40%
Heatmap output written to heatmap_70238/
- Index: heatmap_70238/index.html
- 92 source files analyzed
Index header
Index file list
Single file header
Single file specialisation

I used the UX improvement issue (#142927) for this, but can change it to the main implementation one (#138122) or another.

picnixz commented Dec 18, 2025

Copy link
Copy Markdown
Member

I'd like to suggest using a locale translation for separating numbers instead of using english-based values. I am personally always confused when commas are used to separate thousands and I think it's better if it's using a localized output.

Copy link
Copy Markdown
Member

I disagree with the "Single file specialisation," IMO the plural sounds better and in general zero takes a plural noun form?

hugovk commented Dec 18, 2025

Copy link
Copy Markdown
Member Author

I'd like to suggest using a locale translation for separating numbers instead of using english-based values. I am personally always confused when commas are used to separate thousands and I think it's better if it's using a localized output.

Right now, the numbers are formatted in the Python script, and then put into the HTML. I guess one way would be to put unformatted numbers in the HTML and use some JS to do locale conversion in the browser?

hugovk commented Dec 18, 2025

Copy link
Copy Markdown
Member Author

I disagree with the "Single file specialisation," IMO the plural sounds better and in general zero takes a plural noun form?

"x/y" is like saying "x of y", and it's the "y" that matters for the plural:

  • "0 of 0 instructions"
  • "0 of 1 instruction"
  • "1 of 1 instruction"
  • "1 of 4 instructions"
  • "3 of 4 instructions"

picnixz commented Dec 19, 2025

Copy link
Copy Markdown
Member

Right now, the numbers are formatted in the Python script, and then put into the HTML. I guess one way would be to put unformatted numbers in the HTML and use some JS to do locale conversion in the browser?

Can't we use localized messages? or maybe pass through locale.(...) for formatting numbers?

hugovk commented Dec 19, 2025

Copy link
Copy Markdown
Member Author

Yes, and that's much simpler :)

How does this 9cfd9ef look?

picnixz commented Dec 19, 2025

Copy link
Copy Markdown
Member

It looks better (and simpler). For the "words" we can also use gettext.ngettext to get a possible localized plural form (I don't know if you want all messages to be localized actually, but I think it may makes sense. argparse has localized output and profiling is something that is also very user-facing)

hugovk commented Dec 19, 2025

Copy link
Copy Markdown
Member Author

I'll let you open a followup if you'd like to localise the words :)

pablogsal merged commit ff7f62e into python:main Dec 22, 2025
48 checks passed
hugovk deleted the 3.15-tachyon-formatting branch December 22, 2025 15:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL