gh-149461: argparse: Implement subnamespace feature#149462
Closed
jb2170 wants to merge 8 commits intopython:mainfrom
Closed
gh-149461: argparse: Implement subnamespace feature#149462jb2170 wants to merge 8 commits intopython:mainfrom
subnamespace feature#149462jb2170 wants to merge 8 commits intopython:mainfrom
Conversation
…ation name Like in `_ActionsContainer._get_optional_kwargs`. It makes it much easier to access the subnamespaces by `x.y` instead of needing `getattr(x, 'y')` in the case that y (the subparser choice) has hyphens in it.
I've tried to be in depth, and the tests are commented. Comments can be removed later if one wants, but they're in the git history here for the record.
…_SubParsersAction.add_parser` Instead of it being mixed into kwargs, we keep 'subnamespace' separate like 'deprecated'. This makes it clearer that 'subnamespace' isn't intended as a parameter to be passed to the subparser constructor.
Commit to mark last version in which 'subnamespace' is a string indicating where a subNamespace should be stored in its parent Namespace. We're changing over to using a 'bool' instead, and letting the subnamespace destination be determined by the subparser name automatically. I don't need a git tag for this, just a commit.
Documentation build overview
6 files changed ·
|
Member
|
Closing as per the issue's rationale. We do not have a consensus yet. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes / supersedes #59633 #103639 #103640 #149461
subnamespaceflag to_SubParsersAction.add_parser()to allow nestedNamespaces #149461