mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Make FileType valid for ArgumentParser 'type' arg (#473)
This commit is contained in:
committed by
Matthias Kramm
parent
1bb090d6f8
commit
9fd0fd97c6
@@ -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 = ...,
|
||||
|
||||
Reference in New Issue
Block a user