Update typing-extensions; some 3.12 updates (#10200)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Jelle Zijlstra
2023-05-24 11:06:55 -07:00
committed by GitHub
parent e666602d14
commit e4dcfccbd5
6 changed files with 195 additions and 33 deletions

View File

@@ -136,14 +136,32 @@ Any = object()
@_final
class TypeVar:
__name__: str
__bound__: Any | None
__constraints__: tuple[Any, ...]
__covariant__: bool
__contravariant__: bool
def __init__(
self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
) -> None: ...
@property
def __name__(self) -> str: ...
@property
def __bound__(self) -> Any | None: ...
@property
def __constraints__(self) -> tuple[Any, ...]: ...
@property
def __covariant__(self) -> bool: ...
@property
def __contravariant__(self) -> bool: ...
if sys.version_info >= (3, 12):
@property
def __infer_variance__(self) -> bool: ...
def __init__(
self,
name: str,
*constraints: Any,
bound: Any | None = None,
covariant: bool = False,
contravariant: bool = False,
infer_variance: bool = False,
) -> None: ...
else:
def __init__(
self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
) -> None: ...
if sys.version_info >= (3, 10):
def __or__(self, right: Any) -> _SpecialForm: ...
def __ror__(self, left: Any) -> _SpecialForm: ...
@@ -194,7 +212,8 @@ if sys.version_info >= (3, 11):
LiteralString: _SpecialForm
class TypeVarTuple:
__name__: str
@property
def __name__(self) -> str: ...
def __init__(self, name: str) -> None: ...
def __iter__(self) -> Any: ...
def __typing_subst__(self, arg: Never) -> Never: ...
@@ -202,21 +221,41 @@ if sys.version_info >= (3, 11):
if sys.version_info >= (3, 10):
class ParamSpecArgs:
__origin__: ParamSpec
@property
def __origin__(self) -> ParamSpec: ...
def __init__(self, origin: ParamSpec) -> None: ...
class ParamSpecKwargs:
__origin__: ParamSpec
@property
def __origin__(self) -> ParamSpec: ...
def __init__(self, origin: ParamSpec) -> None: ...
class ParamSpec:
__name__: str
__bound__: Any | None
__covariant__: bool
__contravariant__: bool
def __init__(
self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
) -> None: ...
@property
def __name__(self) -> str: ...
@property
def __bound__(self) -> Any | None: ...
@property
def __covariant__(self) -> bool: ...
@property
def __contravariant__(self) -> bool: ...
if sys.version_info >= (3, 12):
@property
def __infer_variance__(self) -> bool: ...
def __init__(
self,
name: str,
*,
bound: Any | None = None,
contravariant: bool = False,
covariant: bool = False,
infer_variance: bool = False,
) -> None: ...
else:
def __init__(
self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
) -> None: ...
@property
def args(self) -> ParamSpecArgs: ...
@property
@@ -873,3 +912,26 @@ if sys.version_info >= (3, 10):
def is_typeddict(tp: object) -> bool: ...
def _type_repr(obj: object) -> str: ...
if sys.version_info >= (3, 12):
def override(__arg: _F) -> _F: ...
@_final
class TypeAliasType:
def __init__(
self, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()
) -> None: ...
@property
def __value__(self) -> Any: ...
@property
def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ...
@property
def __parameters__(self) -> tuple[Any, ...]: ...
@property
def __name__(self) -> str: ...
# It's writable on types, but not on instances of TypeAliasType.
@property
def __module__(self) -> str | None: ... # type: ignore[override]
def __getitem__(self, parameters: Any) -> Any: ...
if sys.version_info >= (3, 10):
def __or__(self, right: Any) -> _SpecialForm: ...
def __ror__(self, left: Any) -> _SpecialForm: ...