Message108598
| Author |
iElectric |
| Recipients |
bethard, eric.smith, georg.brandl, iElectric |
| Date |
2010年06月25日.13:57:10 |
| SpamBayes Score |
7.802977e-05 |
| Marked as misclassified |
No |
| Message-id |
<1277474232.97.0.350491229915.issue9077@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I agree — not the best example, here is a better one explaining what behavior should not exist:
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foobar', action='store')
>>> parser.add_argument('foobar2', nargs='?')
>>> parser.add_argument('foobar3', nargs='*')
>>> print parser.parse_args(['foo', '--', 'foo3', 'foo3'])
Namespace(foobar='foo', foobar2='foo3', foobar3=['foo3'])
I would expect both foo3 to be part of foobar3. This does not happen because of foobar2 argument eating zero or one argument. Arguments after -- should be left unparsed as such behavior was in optparse. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年06月25日 13:57:13 | iElectric | set | recipients:
+ iElectric, georg.brandl, bethard, eric.smith |
| 2010年06月25日 13:57:12 | iElectric | set | messageid: <1277474232.97.0.350491229915.issue9077@psf.upfronthosting.co.za> |
| 2010年06月25日 13:57:11 | iElectric | link | issue9077 messages |
| 2010年06月25日 13:57:11 | iElectric | create |
|