mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
argparse stub fix: allow subclasses of Action in add_argument(action=...) (#385)
The action was incorrectly typed as allowing instances of Action -- the correct type is subclasses of Action. (And str.)
This commit is contained in:
@@ -48,7 +48,7 @@ class ArgumentParser:
|
||||
add_help: bool = ...) -> None: ...
|
||||
def add_argument(self,
|
||||
*name_or_flags: Union[str, Sequence[str]],
|
||||
action: Union[str, Action] = ...,
|
||||
action: Union[str, Type[Action]] = ...,
|
||||
nargs: Union[int, str] = ...,
|
||||
const: Any = ...,
|
||||
default: Any = ...,
|
||||
@@ -132,7 +132,7 @@ class FileType:
|
||||
class _ArgumentGroup:
|
||||
def add_argument(self,
|
||||
*name_or_flags: Union[str, Sequence[str]],
|
||||
action: Union[str, Action] = ...,
|
||||
action: Union[str, Type[Action]] = ...,
|
||||
nargs: Union[int, str] = ...,
|
||||
const: Any = ...,
|
||||
default: Any = ...,
|
||||
|
||||
Reference in New Issue
Block a user