Message180012
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', nargs='a')
...
File ".../Lib/argparse.py", line 1333, in add_argument
raise ValueError("length of metavar tuple does not match nargs")
ValueError: length of metavar tuple does not match nargs
The message should really be about nargs not having a valid value. The nargs value is invalid regardless of the metavar. There is also this:
>>> parser.add_argument('foo', nargs=-1)
_StoreAction(option_strings=[], dest='foo', nargs=-1, const=None, default=None, type=None, choices=None, help=None, metavar=None)
which is not consistent with this:
>>> parser.add_argument('foo', nargs=0)
...
raise ValueError('nargs for store actions must be > 0; if you '
ValueError: nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate |
|
Date |
User |
Action |
Args |
2013-01-15 12:09:51 | chris.jerdonek | set | recipients:
+ chris.jerdonek, bethard |
2013-01-15 12:09:51 | chris.jerdonek | set | messageid: <1358251791.34.0.358251606196.issue16970@psf.upfronthosting.co.za> |
2013-01-15 12:09:50 | chris.jerdonek | link | issue16970 messages |
2013-01-15 12:09:50 | chris.jerdonek | create | |
|