-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-featureA feature request or enhancementA feature request or enhancement
Description
This issue was brought up and closed as part of issue # 41592.
The add_subparsers method returns a protected _SubParsersAction instance. To add a sub-parser, the public add_parser method of the protected _SubParsersAction instance must be used.
- It is unexpected to require the use of a public method of a protected class instance.
- The protected return type breaks type hinting because
- protected and should not be imported
- it is not available for import
Real world use case example:
sub_parsers_action = parser.add_subparsers(...)
def build_subcmd(sub_parsers_action: _SubParsersAction):
...The ask is to make the type of whatever is returned from add_subparsers public.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Features