[issue21208] Change default behavior of arguments with type bool when options are specified

Josh Rosenberg report at bugs.python.org
Sun Apr 13 03:30:43 CEST 2014


Josh Rosenberg added the comment:

If your goal is to get a boolean on/off switch, that's what action='store_true' is for. You don't need to specify nargs or type at all; using bool as the type means it wants an argument, and will pass the string form of the argument to the bool constructor; since only the empty string is False, it would be quite difficult to pass it intuitively.

----------
nosy: +josh.rosenberg

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21208>
_______________________________________


More information about the Python-bugs-list mailing list