Skip to content

Commit 301351c

Browse files
authored
update argparse's doc of append action. (#92344)
1 parent 299692a commit 301351c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/argparse.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,10 @@ how the command-line arguments should be handled. The supplied actions are:
846846
Namespace(foo=True, bar=False, baz=True)
847847

848848
* ``'append'`` - This stores a list, and appends each argument value to the
849-
list. This is useful to allow an option to be specified multiple times.
850-
Example usage::
849+
list. It is useful to allow an option to be specified multiple times.
850+
If the default value is non-empty, the default elements will be present
851+
in the parsed value for the option, with any values from the
852+
command line appended after those default values. Example usage::
851853

852854
>>> parser = argparse.ArgumentParser()
853855
>>> parser.add_argument('--foo', action='append')

0 commit comments

Comments
 (0)