Proposal for additional `conjunction` parameter in `natural_list` function
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- python
- Domínio
- localization
Direção de pesquisa
Comece localizando a implementação de natural_list e sua documentação; em seguida, revise a discussão relacionada na issue #103. Confirme como a saída padrão atual é produzida e identifique quaisquer testes ou exemplos existentes para natural_list; considera-se concluído quando a conjunção alternativa solicitada for suportada, preservando o comportamento padrão atual.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Thank you for the new version; natural_list really resolves several issues.
Summary
I would like to propose an enhancement to the natural_list function. Currently, the output for the list [1, 2, 3] is formatted as "1, 2 and 3". I propose adding a parameter that allows users to choose between "and" or "or" in the output.
I checked the documentation and found in #103 that there is interest in implementing something like this issue.
Motivation
This enhancement would provide more flexibility in how lists are presented, particularly in contexts where the choice between "and" and "or" is significant.
Proposed Changes
- Introduce a new parameter (e.g.,
conjunction) to thenatural_listfunction. - Accept boolean values for this parameter:
True(default behavior)False
Example Usage
With the proposed change, the usage would look like this:
from humanize import natural_list
print(natural_list([1, 2, 3])) # Output: "1, 2 and 3"
print(natural_list([1, 2, 3], conjunction=False)) # Output: "1, 2 or 3"
Another Idea
We could also consider adding or and and to the i18n support for multiple languages, but I believe that should be addressed in a separate issue.
I could submit the PR if there's interest, but I'm not sure if conjunction would be the best name for this parameter.
- Linguagem predominante
- Python
- Estrelas
- 760
- Forks
- 166
- Merge médio
- 4d 3h
- PRs com merge (30d)
- 7
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
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-humanize/humanize#438 ·
Mantenedores costumam responder em até 2 dias
-
intcomma returns scientific notation for large floatsTalvez já em andamento @TheNetherWatcher assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
python-humanize/humanize#431 ·
Mantenedores costumam responder em até 2 dias
-
docs: document how to run the test suite locallyTalvez já em andamento @yuefdev assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-humanize/humanize#430 ·
Mantenedores costumam responder em até 2 dias
-
metric() adds a digit when a value rounds into quettaTalvez já em andamento @SashaMIT assumiu há 2 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
python-humanize/humanize#423 ·
Mantenedores costumam responder em até 2 dias
-
precisedelta() silently drops the sign of negative timedeltasTalvez já em andamento @Mukller assumiu há 40 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python-humanize/humanize#379 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de python-humanize/humanize
Issues semelhantes
-
Zero-token evaluations are treated as missing cost in selectionTalvez já em andamento @sylvesterkaczmarek assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
google-research/rrsi#6 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
aws-samples/sample-aws-genai-db-modernizer#294 ·
Mantenedores costumam responder em até 1 dia
-
feedback simulation workshop
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
githubnext/gh-aw-workshop#4174 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
WingedGuardian/GENesis-AGI#2852 ·
Mantenedores costumam responder em até 1 dia
-
camlight produces degenerate target camera and light framesTalvez já em andamento @kavyabhand assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
google-deepmind/mujoco_warp#1743 ·
Mantenedores costumam responder em até 1 dia