[issue28734] argparse: successive parsing wipes out nargs=? values

Wolfgang Maier report at bugs.python.org
Fri Nov 18 11:16:36 EST 2016


Wolfgang Maier added the comment:

try this:
parser.add_argument('file', nargs='?', default = argparse.SUPPRESS)

I don't think this is a bug. The default for the default parameter is None so the behavior is consistent with the documentation.

----------
nosy: +wolma

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28734>
_______________________________________


More information about the Python-bugs-list mailing list