This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:11Tristan.Fishersetrecipients: + Tristan.Fisher
2014-09-26 02:13:11Tristan.Fishersetmessageid: <1411697591.54.0.644462520859.issue22500@psf.upfronthosting.co.za>
2014-09-26 02:13:11Tristan.Fisherlinkissue22500 messages
2014-09-26 02:13:11Tristan.Fishercreate