Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc66dfc

Browse filesBrowse files
[3.13] gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) (GH-125538)
(cherry picked from commit c9826c1) Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
1 parent a22e11f commit cc66dfc
Copy full SHA for cc66dfc

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎Doc/library/argparse.rst

Copy file name to clipboardExpand all lines: Doc/library/argparse.rst
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,8 @@ FileType objects
17851785
Argument groups
17861786
^^^^^^^^^^^^^^^
17871787

1788-
.. method:: ArgumentParser.add_argument_group(title=None, description=None)
1788+
.. method:: ArgumentParser.add_argument_group(title=None, description=None, *, \
1789+
[argument_default], [conflict_handler])
17891790

17901791
By default, :class:`ArgumentParser` groups command-line arguments into
17911792
"positional arguments" and "options" when displaying help
@@ -1830,6 +1831,11 @@ Argument groups
18301831

18311832
--bar BAR bar help
18321833

1834+
The optional, keyword-only parameters argument_default_ and conflict_handler_
1835+
allow for finer-grained control of the behavior of the argument group. These
1836+
parameters have the same meaning as in the :class:`ArgumentParser` constructor,
1837+
but apply specifically to the argument group rather than the entire parser.
1838+
18331839
Note that any arguments not in your user-defined groups will end up back
18341840
in the usual "positional arguments" and "optional arguments" sections.
18351841

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.