]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
update argparse's doc of append action. (#92344)
authorHai Shi <shihai1992@gmail.com>
Fri, 6 May 2022 03:32:35 +0000 (11:32 +0800)
committerGitHub <noreply@github.com>
Fri, 6 May 2022 03:32:35 +0000 (22:32 -0500)
Doc/library/argparse.rst

index 5d269cc4eac4a3bb4fda4c7e91f5d8267a7c5780..b5a2b794c2385f87acd9abf428986e928fba5ede 100644 (file)
@@ -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')