naturalsize() ignores the locale decimal separator
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 55/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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?
- Linguagem predominante
- Python
- Estrelas
- 768
- Forks
- 243
- Merge médio
- 4d 12h
- PRs com merge (30d)
- 19
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python-humanize/humanize
-
intcomma returns exponential notation for large floatsTalvez já em andamento @Omarinho12345 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python-humanize/humanize#521 ·
Mantenedores costumam responder em até 1 dia
-
naturalsize() truncates non-integer byte counts below the base ("1 Bytes")Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
python-humanize/humanize#459 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
intcomma returns scientific notation for large floatsTalvez já em andamento @TheNetherWatcher assumiu há 47 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
python-humanize/humanize#431 ·
Mantenedores costumam responder em até 1 dia
-
metric() adds a digit when a value rounds into quettaTalvez já em andamento @SashaMIT assumiu há 49 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
python-humanize/humanize#423 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 25/100
python-humanize/humanize#512 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de python-humanize/humanize
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
mozilla-ai/cq#601 ·
Mantenedores costumam responder em até 1 dia
-
Bump Python to 3.14 or 3.15Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gatesTalvez já em andamento @hat-im assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itTalvez já em andamento @paulo-0308 assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Diaoul/subliminal#1405 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100