FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-83897: Raise on conflicting subparser names. by anntzer · Pull Request #18605 · python/cpython · GitHub

Repository navigation

gh-83897: Raise on conflicting subparser names. - #18605

Merged
miss-islington merged 1 commit into
python:mainfrom
anntzer:argparse-subparser-conflict
May 1, 2022
Merged

miss-islington merged 1 commit into
python:mainfrom
anntzer:argparse-subparser-conflict

Conversation

anntzer commented Feb 22, 2020 •
edited by terryjreedy
Loading

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

make sense.

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

rhettinger self-requested a review April 30, 2022 22:51

Copy link
Copy Markdown
Contributor

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

rhettinger closed this May 1, 2022
rhettinger reopened this May 1, 2022

Copy link
Copy Markdown
Contributor

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

1 similar comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

1 similar comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

miss-islington merged commit ad5e852 into python:main May 1, 2022
anntzer deleted the argparse-subparser-conflict branch May 1, 2022 11:33
eclipseo pushed 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 changed the title bpo-39716: Raise on conflicting subparser names. gh-83897: Raise on conflicting subparser names. Aug 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL