Message163249
| Author |
waltermundt |
| Recipients |
waltermundt |
| Date |
2012年06月20日.04:15:46 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1340165747.87.0.563099760163.issue15112@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|