Opinion: Arguments should not be required for Variadics

オープン
#2,824 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

まず Arguments のドキュメントと、ここで説明されている可変長引数の動作(required=True および argparse との比較を含む)を確認してください。この提案が実行時のセマンティクスを変更するのか、それとも現在のガイダンスを文書化するだけなのかを明確にしてください。完了条件は、合意された動作と、それに対応するドキュメントおよびテストの範囲が定められていることです。

索引モデルが issue の本文から書いたものです。

説明

parsing

Docs:

  • Arguments:
    If you come from argparse, you might be missing support for setting nargs to + to indicate that at least one argument is required.
    This is supported by setting required=True. However, this should not be used if you can avoid it as we believe scripts should gracefully degrade into becoming noops if a variadic argument is empty. The reason for this is that very often, scripts are invoked with wildcard inputs from the command line and they should not error out if the wildcard is empty.

Reasoning:
Beyond the reasoning stated, I don't know of any.

Feature unlocked: N/A

主要言語
Python
スター
17.8k
フォーク
3.3k
平均マージ
3日 3時間
マージ済み PR(30日)
13

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pallets/click のほかの issue

pallets/click の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。