Skip to content

Commit cba0418

Browse files
Rephrase
1 parent 7eb347b commit cba0418

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Doc/library/argparse.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,8 @@ behavior::
13711371

13721372
Multiple arguments may share the same ``dest``. By default the value from the
13731373
last such argument given on the command line wins; use ``action='append'`` to
1374-
collect values from all of them into a list instead.
1374+
collect values from all of them into a list instead. (For conflicting *option
1375+
strings* rather than ``dest`` names, see conflict_handler_.)
13751376

13761377
.. versionchanged:: 3.15
13771378
Single-dash long option now takes precedence over short options.
@@ -1781,6 +1782,10 @@ Subcommands
17811782
present, and when the ``b`` command is specified, only the ``foo`` and
17821783
``baz`` attributes are present.
17831784

1785+
If a subparser defines an argument with the same ``dest`` as the parent
1786+
parser, the subparser's value overwrites the parent's, so users should give
1787+
them distinct ``dest`` values to keep both.
1788+
17841789
Similarly, when a help message is requested from a subparser, only the help
17851790
for that particular parser will be printed. The help message will not
17861791
include parent parser or sibling parser messages. (A help message for each

0 commit comments

Comments
 (0)