typing: update and fix for py310 (#5287)

This commit is contained in:
Shantanu
2021-05-01 21:09:26 -07:00
committed by GitHub
parent 2d69d1a695
commit 3aa1f2d42f
2 changed files with 39 additions and 9 deletions

View File

@@ -56,9 +56,24 @@ if sys.version_info < (3, 7):
class GenericMeta(type): ...
if sys.version_info >= (3, 10):
class ParamSpecArgs:
__origin__: ParamSpec
def __init__(self, origin: ParamSpec) -> None: ...
class ParamSpecKwargs:
__origin__: ParamSpec
def __init__(self, origin: ParamSpec) -> None: ...
class ParamSpec:
__name__: str
def __init__(self, name: str) -> None: ...
__bound__: Optional[Type[Any]]
__covariant__: bool
__contravariant__: bool
def __init__(
self, name: str, bound: Union[None, Type[Any], str] = ..., contravariant: bool = ..., covariant: bool = ...
) -> None: ...
@property
def args(self) -> ParamSpecArgs: ...
@property
def kwargs(self) -> ParamSpecKwargs: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
@@ -681,3 +696,6 @@ if sys.version_info >= (3, 7):
def __eq__(self, other: Any) -> bool: ...
def __hash__(self) -> int: ...
def __repr__(self) -> str: ...
if sys.version_info >= (3, 10):
def is_typeddict(tp: Any) -> bool: ...