Emitting underscores in integers
まだ誰も着手していません。
評価
調査の方向性
issue では、ファイル、テスト、エントリーポイントのいずれも指定されていません。まず、カスタマイズが求められているのか、または事前フォーマット済み文字列用の API が求められているのかを明確にし、そのうえで、有効なアンダースコア形式の TOML 整数を引用符なしで出力することを受け入れ条件として定義してください。
索引モデルが issue の本文から書いたものです。
説明
TOML allows an underscore anywhere in an integer, as long as there is a digit each side of it:
For large numbers, you may use underscores between digits to enhance readability. Each underscore must be surrounded by at least one digit on each side.
int5 = 1_000 int6 = 5_349_221 int7 = 53_49_221 # Indian number system grouping int8 = 1_2_3_4_5 # VALID but discouraged
I'd like to be able to emit an underscore-formatted integer when dump/sing a TOML file.
This is probably quite hard to implement with full flexibility, but it would be good to either be able to indicate some level of customisation, e.g. "use an underscore to indicate 100s" or "use an underscore to indicate 1000s", or alternatively to be able to supply a _-formatted integer as a string, and have tomlkit render it as a number, without quotation marks.
Happy to discuss if there's interest. Otherwise I can try a PR, but I'd rather get some consensus first.
- 主要言語
- Python
- スター
- 850
- フォーク
- 163
- 平均マージ
- 13分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-poetry/tomlkit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
python-poetry/tomlkit#546 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
python-poetry/tomlkit#603 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
python-poetry/tomlkit#580 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
python-poetry/tomlkit#577 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
python-poetry/tomlkit#574 · コメント 5 件 ·
python-poetry/tomlkit の issue をすべて見る
似ている issue
-
area: harness bug status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Human-Agent-Society/reef#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
learningequality/kolibri#15351 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Name consistency オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eellak/triplestore#65 · コメント 1 件 ·