python / python/cpython

argparse: undocumented `nargs` constants `ONE_OR_MORE`, `OPTIONAL`, `PARSER`, `REMAINDER`, `ZERO_OR_MORE`, `SUPPRESS`

未關閉
#118,920 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs
主要語言
Python
星號
77.2k
分支
35.9k
PR 合併指標
PR 指標待擷取

描述

Concerning the possible values of the nargs parameter of add_argument().

The following values are already described in the documentation, so only a mention of the constants is needed:

  • OPTIONAL = ?
  • ZERO_OR_MORE = *
  • ONE_OR_MORE = +

The following constants and their values do not seem to be documented anywhere:

  • PARSER
  • REMAINDER

SUPPRESS constant was documented for help parameter in https://github.com/python/cpython/issues/53595, but not for nargs.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先查看 argparse 中 ArgumentParser.add_argument() 及其 nargs 參數的文件,然後檢查現有的 help 參數文件如何描述 SUPPRESS。為 issue 中列出的 nargs 常數撰寫文件,包括 OPTIONAL、ZERO_OR_MORE 和 ONE_OR_MORE 的值,以及缺少的 PARSER 和 REMAINDER 描述;當所有列出的常數都已涵蓋時完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。