Message227584
It's my understanding that giving the action="store_true" to an argument in argparse defaults to False. When using non-double-dashed/positional arguments, the argument resorts to True (even if explicitly marked default=False).
I've attached a minimal example, but, for clarity, the relevant line is as such:
parser.add_argument("meow", action="store_true", default=False)
I realize that this might strike some as an odd usage, and I always have the option of using "--meow," but I found it odd that a positional argument is always True, even if not specified in sys.argv. |
|
Date |
User |
Action |
Args |
2014-09-26 02:13:11 | Tristan.Fisher | set | recipients:
+ Tristan.Fisher |
2014-09-26 02:13:11 | Tristan.Fisher | set | messageid: <1411697591.54.0.644462520859.issue22500@psf.upfronthosting.co.za> |
2014-09-26 02:13:11 | Tristan.Fisher | link | issue22500 messages |
2014-09-26 02:13:11 | Tristan.Fisher | create | |
|