[Python-checkins] update argparse's doc of append action. (#92344)
rhettinger
webhook-mailer at python.org
Thu May 5 23:32:40 EDT 2022
https://github.com/python/cpython/commit/301351c6a227249770fdf498054e6bbce1c3ee3c
commit: 301351c6a227249770fdf498054e6bbce1c3ee3c
branch: main
author: Hai Shi <shihai1992 at gmail.com>
committer: rhettinger <rhettinger at users.noreply.github.com>
date: 2022-05-05T22:32:35-05:00
summary:
update argparse's doc of append action. (#92344)
files:
M Doc/library/argparse.rst
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 5d269cc4eac4a..b5a2b794c2385 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -846,8 +846,10 @@ how the command-line arguments should be handled. The supplied actions are:
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.
- Example usage::
+ list. It is useful to allow an option to be specified multiple times.
+ If the default value is non-empty, the default elements will be present
+ in the parsed value for the option, with any values from the
+ command line appended after those default values. Example usage::
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action='append')
More information about the Python-checkins
mailing list