Skip to content

Commit 1cab726

Browse files
[3.12] gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) (GH-125539)
(cherry picked from commit c9826c1) Co-authored-by: Savannah Ostrowski <[email protected]>
1 parent 0a82c4c commit 1cab726

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Doc/library/argparse.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,8 @@ FileType objects
17401740
Argument groups
17411741
^^^^^^^^^^^^^^^
17421742

1743-
.. method:: ArgumentParser.add_argument_group(title=None, description=None)
1743+
.. method:: ArgumentParser.add_argument_group(title=None, description=None, *, \
1744+
[argument_default], [conflict_handler])
17441745

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

17861787
--bar BAR bar help
17871788

1789+
The optional, keyword-only parameters argument_default_ and conflict_handler_
1790+
allow for finer-grained control of the behavior of the argument group. These
1791+
parameters have the same meaning as in the :class:`ArgumentParser` constructor,
1792+
but apply specifically to the argument group rather than the entire parser.
1793+
17881794
Note that any arguments not in your user-defined groups will end up back
17891795
in the usual "positional arguments" and "optional arguments" sections.
17901796

0 commit comments

Comments
 (0)