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:
jdelic
2016-07-22 23:38:24 +02:00
committed by Guido van Rossum
parent 05cd6ec5fa
commit 791966a65a

View File

@@ -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 = ...,