Message331837
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('things', nargs=argparse.REMAINDER, default=['nothing'])
parser.parse_args([])
>>> Namespace(things=[])
Since there were no unparsed arguments remaining, the `default` setting for `things` should have been honored. However it silently ignores this setting.
If there's a reason why this wouldn't be desirable, it should raise an exception that the options aren't compatible. |
|
Date |
User |
Action |
Args |
2018-12-14 15:59:40 | rgov | set | recipients:
+ rgov |
2018-12-14 15:59:40 | rgov | set | messageid: <1544803180.32.0.788709270274.issue35495@psf.upfronthosting.co.za> |
2018-12-14 15:59:40 | rgov | link | issue35495 messages |
2018-12-14 15:59:40 | rgov | create | |
|