mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
fix: resolve issue with SubParsersAction.add_parser for custom ArgumentParser subclasses (#12212)
This commit is contained in:
@@ -700,6 +700,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
add_help: bool = ...,
|
||||
allow_abbrev: bool = ...,
|
||||
exit_on_error: bool = ...,
|
||||
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
||||
) -> _ArgumentParserT: ...
|
||||
elif sys.version_info >= (3, 9):
|
||||
def add_parser(
|
||||
@@ -722,6 +723,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
add_help: bool = ...,
|
||||
allow_abbrev: bool = ...,
|
||||
exit_on_error: bool = ...,
|
||||
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
||||
) -> _ArgumentParserT: ...
|
||||
else:
|
||||
def add_parser(
|
||||
@@ -743,6 +745,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
conflict_handler: str = ...,
|
||||
add_help: bool = ...,
|
||||
allow_abbrev: bool = ...,
|
||||
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
||||
) -> _ArgumentParserT: ...
|
||||
|
||||
def _get_subactions(self) -> list[Action]: ...
|
||||
|
||||
Reference in New Issue
Block a user