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

bpo-39716: Raise on conflicting subparser names. #18605

Merged
merged 1 commit into from May 1, 2022

Conversation

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.)

https://bugs.python.org/issue39716

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

@shihai1991 shihai1991 Feb 26, 2020

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

@anntzer anntzer Feb 26, 2020

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

@shihai1991 shihai1991 Feb 26, 2020

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 Apr 30, 2022
@rhettinger rhettinger added the 🤖 automerge label Apr 30, 2022
@miss-islington
Copy link

@miss-islington miss-islington commented Apr 30, 2022

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

@miss-islington miss-islington commented May 1, 2022

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

1 similar comment
@miss-islington
Copy link

@miss-islington miss-islington commented May 1, 2022

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

@miss-islington
Copy link

@miss-islington miss-islington commented May 1, 2022

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

@miss-islington
Copy link

@miss-islington miss-islington commented May 1, 2022

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

@miss-islington
Copy link

@miss-islington miss-islington commented May 1, 2022

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

1 similar comment
@miss-islington
Copy link

@miss-islington miss-islington commented May 1, 2022

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

@miss-islington
Copy link

@miss-islington miss-islington commented May 1, 2022

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

@miss-islington miss-islington merged commit ad5e852 into python:main May 1, 2022
19 checks passed
@anntzer anntzer deleted the argparse-subparser-conflict branch May 1, 2022
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue May 1, 2022
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
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue May 1, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed 🤖 automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants