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 pgacv2
Recipients pgacv2
Date 2017-02-23.13:31:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487856667.94.0.619514979386.issue29632@psf.upfronthosting.co.za>
In-reply-to
Content
The possible values for action are currently:
'store'
'store_true'
'store_false'
'store_const'
'append'
'append_const'
'count'
'help'
'version'
a subclass of argparse.Action

The string values are evidently for backward compatibility with optparse. However, adding the ability to specify these options as flags would make argparse code more maintainable (e.g. IDEs are better at refactoring symbols than strings), bring it in line with other places where a module has built-in flags, like the regex module (re.MULTILINE, re.IGNORECASE, etc.), and expand the use of flags that already exist in argparse (e.g. argparse.SUPPRESS, argparse.REMAINDER).

The string values need not be immediately deprecated, but can be made available as the preferred option for new development. See, for example, getName() and setName() in the threading module, which are documented as follows: "Old getter/setter API for name; use it directly as a property instead." A similar suggestion can be provided for argparse flags: "Old action values for backward compatibility; use the flags instead."
History
Date User Action Args
2017-02-23 13:31:07pgacv2setrecipients: + pgacv2
2017-02-23 13:31:07pgacv2setmessageid: <1487856667.94.0.619514979386.issue29632@psf.upfronthosting.co.za>
2017-02-23 13:31:07pgacv2linkissue29632 messages
2017-02-23 13:31:07pgacv2create