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-83897: Raise on conflicting subparser names. #18605

Merged
merged 1 commit into from
May 1, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 22, 2020

Raise an ArgumentError when the same subparser name is added twice to an
ArgumentParser. This is consistent with the (default) behavior when the
same option string is added twice to an ArgumentParser.

(Support for conflict_handler="resolve" could be considered as a
followup feature, although real use cases seem even rarer than
"resolve"ing option-strings.)

Automerge-Triggered-By: GH:rhettinger

Raise an ArgumentError when the same subparser name is added twice to an
ArgumentParser.  This is consistent with the (default) behavior when the
same option string is added twice to an ArgumentParser.

(Support for `conflict_handler="resolve"` could be considered as a
followup feature, although real use cases seem even rarer than
"resolve"ing option-strings.)
@@ -0,0 +1,3 @@
Raise an ArgumentError when the same subparser name is added twice to an
Copy link
Member

Choose a reason for hiding this comment

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

How about using added twice or more to replace added twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You won't be able to add it more than twice if it errors out on the second addition...

Copy link
Member

Choose a reason for hiding this comment

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

make sense.

@rhettinger Hi, raymond. Pls review this PR if you have free time.

@rhettinger rhettinger self-requested a review April 30, 2022 22:51
@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: 3 of 7 required status checks are expected..

@rhettinger rhettinger closed this May 1, 2022
@rhettinger rhettinger reopened this May 1, 2022
@miss-islington
Copy link
Contributor

@anntzer: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor

@anntzer: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: 4 of 7 required status checks are expected..

@miss-islington
Copy link
Contributor

@anntzer: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: 4 of 7 required status checks are expected..

1 similar comment
@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: 4 of 7 required status checks are expected..

@miss-islington
Copy link
Contributor

@anntzer: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit ad5e852 into python:main May 1, 2022
@anntzer anntzer deleted the argparse-subparser-conflict branch May 1, 2022 11:33
eclipseo added a commit to eclipseo/rfpkg that referenced this pull request Jun 26, 2022
Don't register again the retire command as it is already done
by pyrpkg. Starting Python 3.11, it creates an error.
See python/cpython#18605

Fix rpmfusion-infra#24
sergiomb2 pushed a commit to rpmfusion-infra/rfpkg that referenced this pull request Jun 27, 2022
Don't register again the retire command as it is already done
by pyrpkg. Starting Python 3.11, it creates an error.
See python/cpython#18605

Fix #24
@terryjreedy terryjreedy changed the title bpo-39716: Raise on conflicting subparser names. gh-83897: Raise on conflicting subparser names. Aug 16, 2023
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.

6 participants