Proposal for additional `conjunction` parameter in `natural_list` function
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- localization
調査の方向性
まず natural_list の実装とそのドキュメントを見つけ、次に issue #103 の関連する議論を確認します。現在のデフォルト出力がどのように生成されるかを確認し、natural_list の既存のテストまたは例を特定します。現在のデフォルトの動作を維持したまま、要求された代替の接続詞をサポートできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 757
- フォーク
- 148
- 平均マージ
- 6日 1時間
- マージ済み PR(30日)
- 12
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-humanize/humanize のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
python-humanize/humanize#379 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
python-humanize/humanize#366 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
python-humanize/humanize#356 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
python-humanize/humanize#277 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
python-humanize/humanize#270 · コメント 6 件 ·
python-humanize/humanize の issue をすべて見る
似ている issue
-
triage/confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
NousResearch/hermes-agent#118866 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
apache/cloudstack#14222 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100