naturalsize() ignores the locale decimal separator
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Read the naturalsize() implementation and the decimal_separator() usage in intword() and intcomma(). Reproduce the comma-decimal example for a listed locale, then check the existing naturalsize benchmarks, including the regression noted for test_naturalsize. Done means naturalsize() uses the locale separator while preserving the default-period performance path and the benchmark result is checked; the issue leaves sequencing around PRs #403, #457, and #367 unresolved.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On current main, with a locale whose decimal separator is a comma:
>>> import humanize
>>> humanize.i18n.activate("fr_FR")
>>> humanize.intcomma(1.5)
'1,5'
>>> humanize.naturalsize(1_500_000)
'1.5 Mo'
The same happens for every locale with "," as the decimal separator (de_DE, fr_FR, hu_HU, it_IT, lv, pt_BR). intword() and intcomma() use decimal_separator(), but naturalsize() does not.
#378 mentioned that naturalsize was left untouched as "the one loose end", and #357 got a ~10% CodSpeed regression on test_naturalsize when it tried to fix this.
Proposal: use decimal_separator() in naturalsize(), but skip the extra work when the separator is "." so the default path is not slowed down, and check the result against the existing benchmarks.
Open PRs #403, #457 and #367 also touch naturalsize(). Would you prefer us to wait for them, or go ahead and rebase later?
- Lingua principale
- Python
- Stelle
- 768
- Fork
- 243
- Merge medio
- 4g 12h
- PR unite (30g)
- 19
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-humanize/humanize
-
intcomma returns exponential notation for large floatsForse già presa @Omarinho12345 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
python-humanize/humanize#521 ·
I maintainer di solito rispondono entro 1 giorno
-
naturalsize() truncates non-integer byte counts below the base ("1 Bytes")Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
python-humanize/humanize#459 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
intcomma returns scientific notation for large floatsForse già presa @TheNetherWatcher l’ha presa 47 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
python-humanize/humanize#431 ·
I maintainer di solito rispondono entro 1 giorno
-
metric() adds a digit when a value rounds into quettaForse già presa @SashaMIT l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
python-humanize/humanize#423 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
python-humanize/humanize#512 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di python-humanize/humanize
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
mozilla-ai/cq#601 ·
I maintainer di solito rispondono entro 1 giorno
-
Bump Python to 3.14 or 3.15Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gatesForse già presa @hat-im l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itForse già presa @paulo-0308 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Diaoul/subliminal#1405 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100