mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 16:14:24 +08:00
Fix py2 unicode handling for ArgumentParser.add_argument's text arg (#2051)
add_argument's type argument was recently changed to be (approximately) `Callable[[_Text], _T]`. Because of contravariant subtyping for functions, this had the effect of requiring that add_argument *always* be unicode, which is wrong. Change it to be `Callable[[str], _T]`.
This commit is contained in:
committed by
Jelle Zijlstra
parent
b1a0b8ad6e
commit
d63866bd36
@@ -57,7 +57,7 @@ class _ActionsContainer:
|
||||
nargs: Union[int, _Text] = ...,
|
||||
const: Any = ...,
|
||||
default: Any = ...,
|
||||
type: Union[Callable[[_Text], _T], FileType] = ...,
|
||||
type: Union[Callable[[str], _T], FileType] = ...,
|
||||
choices: Iterable[_T] = ...,
|
||||
required: bool = ...,
|
||||
help: Optional[_Text] = ...,
|
||||
|
||||
Reference in New Issue
Block a user