Skip to content
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

GH-127133: Remove ability to nest argument groups & mutually exclusive groups #127186

Merged
merged 12 commits into from
Nov 24, 2024

Conversation

savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Nov 23, 2024

This PR removes the ability to:

  • Call add_argument_group on an argument group
  • Call add_argument_group or add_mutually_exclusive_group on a mutually exclusive group

We have been warning users of this deprecation since 3.11.


📚 Documentation preview 📚: https://cpython-previews--127186.org.readthedocs.build/

Lib/argparse.py Outdated Show resolved Hide resolved
@savannahostrowski
Copy link
Member Author

@iritkatriel Perhaps you can take a look at this one if you've got bandwidth, since you added the original deprecation warnings ☺️

@savannahostrowski
Copy link
Member Author

savannahostrowski commented Nov 23, 2024

Hmm, let me double-check that there aren't other formatting simplifications we can make now as a result of dropping this.

I took a look and ran branch coverage with a couple of different programs, and nothing stood out to me, so I think it's fine to proceed with this and then tackle any other potential refactorings in separate PRs.

@savannahostrowski savannahostrowski marked this pull request as ready for review November 23, 2024 06:06
Lib/test/test_argparse.py Outdated Show resolved Hide resolved
Lib/argparse.py Outdated Show resolved Hide resolved
Lib/argparse.py Outdated Show resolved Hide resolved
Doc/library/argparse.rst Outdated Show resolved Hide resolved
@savannahostrowski savannahostrowski changed the title GH-127133: Remove ability to nest argument groups and mutex groups GH-127133: Remove ability to nest argument groups & mutually exclusive groups Nov 24, 2024
@iritkatriel iritkatriel enabled auto-merge (squash) November 24, 2024 15:20
@iritkatriel iritkatriel merged commit 2104bde into python:main Nov 24, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raise exception when nesting argument groups and mutually exclusive groups
2 participants