[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument
Michael Blahay
report at bugs.python.org
Tue May 7 17:10:42 EDT 2019
Michael Blahay <mblahay at gmail.com> added the comment:
Ryan, what are the exact steps to reproduce the problem? This is what I get when I run the code you included:
>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('things', nargs=argparse.REMAINDER, default=['nothing'])
_StoreAction(option_strings=[], dest='things', nargs='...', const=None, default=['nothing'], type=None, choices=None, help=None, metavar=None)
>>> parser.parse_args([])
Namespace(things=[])
>>> Namespace(things=[])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Namespace' is not defined
----------
nosy: +mblahay
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35495>
_______________________________________
More information about the Python-bugs-list
mailing list