Make FileType valid for ArgumentParser 'type' arg (#473)

This commit is contained in:
Tom Manderson
2016-08-16 04:42:48 +10:00
committed by Matthias Kramm
parent 1bb090d6f8
commit 9fd0fd97c6

View File

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