From 9fd0fd97c6a07bf0fcd6396fc45623fe7f5594b9 Mon Sep 17 00:00:00 2001 From: Tom Manderson Date: Tue, 16 Aug 2016 04:42:48 +1000 Subject: [PATCH] Make FileType valid for ArgumentParser 'type' arg (#473) --- stdlib/2and3/argparse.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/2and3/argparse.pyi b/stdlib/2and3/argparse.pyi index 4a0918098..32b734c67 100644 --- a/stdlib/2and3/argparse.pyi +++ b/stdlib/2and3/argparse.pyi @@ -52,7 +52,7 @@ class ArgumentParser: nargs: Union[int, str] = ..., const: Any = ..., default: Any = ..., - type: Callable[[str], _T] = ..., + type: Union[Callable[[str], _T], FileType] = ..., choices: Iterable[_T] = ..., required: bool = ..., help: str = ..., @@ -103,7 +103,7 @@ class Action: nargs: Optional[Union[int, str]] = ..., const: Any = ..., default: Any = ..., - type: Optional[Callable[[str], _T]] = ..., + type: Union[Callable[[str], _T], FileType, None] = ..., choices: Optional[Iterable[_T]] = ..., required: bool = ..., help: Optional[str] = ..., @@ -136,7 +136,7 @@ class _ArgumentGroup: nargs: Union[int, str] = ..., const: Any = ..., default: Any = ..., - type: Callable[[str], _T] = ..., + type: Union[Callable[[str], _T], FileType] = ..., choices: Iterable[_T] = ..., required: bool = ..., help: str = ...,