[feature request] Exclude function (kw)args from synopsis, arguments and flags in help output
まだ誰も着手していません。
評価
調査の方向性
この issue では、ファイル、テスト、エントリポイントが指定されていません。まず、ヘルプの概要、引数、フラグを構築するコードを特定し、次にアンダースコアの除外、リテラルのみの除外、型/モジュールの除外という提案されたアプローチを比較してください。完了条件は、合意された除外 API と、除外されたキーワード引数が各ヘルプセクションに表示されなくなったことを示すテストです。
索引モデルが issue の本文から書いたものです。
説明
The help output lists all function (keyword) arguments in the synopsis, arguments and flags.
In my specific use case, I would like to exclude some of those arguments, because they are:
- of non-literal type, and therefore not easily provided through the means of CLI
- injected by a dependency injection decorator
The option to exclude (keyword) arguments could be done in a couple of ways:
- prefix the argument name with an underscore, e.g.
def my_function(a: bool, _complex_type: ComplexType = ComplexType()):
...
- limit args and kwargs to literal types
fire.Fire(help_include_literals_only=True)
- provide the means to exclude arguments based on module or instance type, e.g.
def my_function(a: bool, s: service.ComplexType):
...
fire.Fire(
help_exclude_arg_types=[service.ComplexType],
help_exclude_arg_modules=[service]
)
- 主要言語
- Python
- スター
- 28.2k
- フォーク
- 1.5k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/python-fire のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
google/python-fire#693 ·
-
Release 0.7.2? オープン
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
google/python-fire#698 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
google/python-fire#672 · コメント 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
google/python-fire#665 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
google/python-fire#659 · コメント 1 件 ·
google/python-fire の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
learningequality/ricecooker#747 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
KhronosGroup/glTF-Blender-IO#2769 ·