Message227584
| Author |
Tristan.Fisher |
| Recipients |
Tristan.Fisher |
| Date |
2014年09月26日.02:13:10 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1411697591.54.0.644462520859.issue22500@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|