diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index db5fae2006678a..23538c22a8d6f6 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1369,6 +1369,11 @@ behavior:: >>> parser.parse_args('--foo XXX'.split()) Namespace(bar='XXX') +Multiple arguments may share the same ``dest``. By default, the value from the +last such argument given on the command line wins. Use ``action='append'`` to +collect values from all of them into a list instead. For conflicting *option +strings* rather than ``dest`` names, see conflict_handler_. + .. versionchanged:: 3.15 Single-dash long option now takes precedence over short options. @@ -1777,6 +1782,10 @@ Subcommands present, and when the ``b`` command is specified, only the ``foo`` and ``baz`` attributes are present. + If a subparser defines an argument with the same ``dest`` as the parent + parser, the subparser's value overwrites the parent's, so users should give + them distinct ``dest`` values to keep both. + Similarly, when a help message is requested from a subparser, only the help for that particular parser will be printed. The help message will not include parent parser or sibling parser messages. (A help message for each