[docs] [issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

Martin Panter report at bugs.python.org
Thu Jan 28 17:06:17 EST 2016

Martin Panter added the comment:

I definitely agree with removing the remark about the “const” value with store_const. People here seem to be overloading the terms “default” and “argument”. When using store_const, it seems the programmer must also specify a value for the “const” parameter to add_argument(). It is incorrect to say it is None if not explicitly set.

On the other hand, I think if the end user omits a CLI argument configured with store_const, then the argparse module will substitute None, or the value of the “default” parameter to add_argument().

For the original report about store_true/false, perhapse it would be sufficient to port revision 49677cc6d83a to Python 3. Although there is a stray “using” that should probably be fixed.

nosy: +martin.panter
versions: +Python 2.7, Python 3.5, Python 3.6

Python tracker <report at bugs.python.org>

More information about the docs mailing list