cpython icon indicating copy to clipboard operation
cpython copied to clipboard

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

Open rindeal opened this issue 1 month ago • 1 comments

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.

rindeal avatar May 10 '24 19:05 rindeal