X Tutup
The Wayback Machine - https://web.archive.org/web/20260216072757/https://github.com/python/cpython/pull/29192
Skip to content

bpo-45587: Distinguish title and description arguments from **kwargs in add_argument_group methods#29192

Closed
jb2170 wants to merge 3 commits intopython:mainfrom
jb2170:fix-issue-45587
Closed

bpo-45587: Distinguish title and description arguments from **kwargs in add_argument_group methods#29192
jb2170 wants to merge 3 commits intopython:mainfrom
jb2170:fix-issue-45587

Conversation

@jb2170
Copy link
Contributor

@jb2170 jb2170 commented Oct 23, 2021

Hi, this adds clarity to the add_argument_group method within the argparse module by separating the important title and description keyword arguments from the other **kwargs.

The method signature has been changed from
add_argument_group(self, *args, **kwargs) to
add_argument_group(self, title=None, description=None, **kwargs)

Observe that *args has been removed; it was never used. This is a backwards compatible change as any code that uses eg parser.add_argument_group('myTitle', 'myDescription') will fill out the first two correct keyword arguments, which was already the existing behaviour.

The documentation has been made consistent to these changes.

https://bugs.python.org/issue45587

Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran 1672 tests in 9.180s
OK
Docs looks ok too.

@iritkatriel
Copy link
Member

Updated branch to kick off a new test run.

@rhettinger You approved this back in May. Any reason not to merge it?

Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs build failed:

Error: ../Misc/NEWS.d/next/Library/2021-10-23-14-08-59.bpo-45587.1-DdhN.rst:2: default role used (hint: for inline literals, use double backticks) (default-role)

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@ghost
Copy link

ghost commented Nov 26, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@jb2170 jb2170 force-pushed the fix-issue-45587 branch 3 times, most recently from b21817d to 5fa5983 Compare November 26, 2022 22:13
@bedevere-bot
Copy link

Thanks for making the requested changes!

@iritkatriel, @rhettinger: please review the changes made to this pull request.

jb2170 and others added 3 commits January 13, 2023 19:22
…ment_group methods

This is in keeping with the existing documentation that shows add_argument_group to take two keyword arguments, title and description
@bedevere-bot
Copy link

Thanks for making the requested changes!

@rhettinger, @iritkatriel: please review the changes made to this pull request.

@jb2170
Copy link
Contributor Author

jb2170 commented Apr 23, 2023

Closed due to inactivity

@jb2170 jb2170 closed this Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

X Tutup