Message163249
Test case:
from argparse import *
parser = ArgumentParser()
parser.add_argument('-x', action='store_true')
parser.add_argument('y')
parser.add_argument('z', nargs='*')
print parser.parse_args('yy -x zz'.split(' '))
The result of this is that the "z" option is unfilled, and the "zz" argument is unrecognized, resulting in an error. Changing the 'nargs' to '+' works in this case, but results in errors if the 'zz' is left off. |
|
Date |
User |
Action |
Args |
2012-06-20 04:15:48 | waltermundt | set | recipients:
+ waltermundt |
2012-06-20 04:15:47 | waltermundt | set | messageid: <1340165747.87.0.563099760163.issue15112@psf.upfronthosting.co.za> |
2012-06-20 04:15:47 | waltermundt | link | issue15112 messages |
2012-06-20 04:15:46 | waltermundt | create | |
|