Skip to content

[3.12] gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) #125539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,8 @@ FileType objects
Argument groups
^^^^^^^^^^^^^^^

.. method:: ArgumentParser.add_argument_group(title=None, description=None)
.. method:: ArgumentParser.add_argument_group(title=None, description=None, *, \
[argument_default], [conflict_handler])

By default, :class:`ArgumentParser` groups command-line arguments into
"positional arguments" and "options" when displaying help
Expand Down Expand Up @@ -1785,6 +1786,11 @@ Argument groups

--bar BAR bar help

The optional, keyword-only parameters argument_default_ and conflict_handler_
allow for finer-grained control of the behavior of the argument group. These
parameters have the same meaning as in the :class:`ArgumentParser` constructor,
but apply specifically to the argument group rather than the entire parser.

Note that any arguments not in your user-defined groups will end up back
in the usual "positional arguments" and "optional arguments" sections.

Expand Down
Loading