summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-03-28 06:13:52 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-03-28 06:13:52 (GMT)
commiteba25880f8f83d8153135558d5df2dec36e3d784 (patch)
treec880146b42f7574ea0a93abdb3f01112425e1ea4 /Doc
parentef4bb1e994fbb7cab5ae29bb1d6763e0e7306642 (diff)
parentf9cddccf8c165f461ace35302187ce32a3c38d7f (diff)
downloadcpython-eba25880f8f83d8153135558d5df2dec36e3d784.zip
cpython-eba25880f8f83d8153135558d5df2dec36e3d784.tar.gz
cpython-eba25880f8f83d8153135558d5df2dec36e3d784.tar.bz2
Issue #25314: Merge argparse doc from 3.5
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/argparse.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 2877437..785ecbf 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -729,15 +729,17 @@ how the command-line arguments should be handled. The supplied actions are:
>>> parser.parse_args('--foo'.split())
Namespace(foo=42)
-* ``'store_true'`` and ``'store_false'`` - These store the values ``True`` and
- ``False`` respectively. These are special cases of ``'store_const'``. For
- example::
+* ``'store_true'`` and ``'store_false'`` - These are special cases of
+ ``'store_const'`` used for storing the values ``True`` and ``False``
+ respectively. In addition, they create default values of ``False`` and
+ ``True`` respectively. For example::
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action='store_true')
>>> parser.add_argument('--bar', action='store_false')
+ >>> parser.add_argument('--baz', action='store_false')
>>> parser.parse_args('--foo --bar'.split())
- Namespace(bar=False, foo=True)
+ Namespace(foo=True, bar=False, baz=True)
* ``'append'`` - This stores a list, and appends each argument value to the
list. This is useful to allow an option to be specified multiple times.