Skip to content

Commit 80b5f3a

Browse files
Add typing.TypeVarTuple, Unpack, assert_type
python/cpython#31021 and python/cpython#30843.
1 parent ba475a0 commit 80b5f3a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stdlib/typing.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ if sys.version_info >= (3, 11):
2828
"Tuple",
2929
"Type",
3030
"TypeVar",
31+
"TypeVarTuple",
3132
"Union",
33+
"Unpack",
3234
"AbstractSet",
3335
"ByteString",
3436
"Container",
@@ -80,6 +82,7 @@ if sys.version_info >= (3, 11):
8082
"TextIO",
8183
"AnyStr",
8284
"assert_never",
85+
"assert_type",
8386
"cast",
8487
"final",
8588
"get_args",
@@ -524,6 +527,12 @@ if sys.version_info >= (3, 8):
524527
if sys.version_info >= (3, 11):
525528
Self: _SpecialForm
526529
Never: _SpecialForm = ...
530+
Unpack: _SpecialForm
531+
532+
class TypeVarTuple:
533+
__name__: str
534+
def __init__(self, name: str) -> None: ...
535+
def __iter__(self) -> Any: ...
527536

528537
if sys.version_info < (3, 7):
529538
class GenericMeta(type): ...
@@ -1176,6 +1185,7 @@ def cast(typ: object, val: Any) -> Any: ...
11761185
if sys.version_info >= (3, 11):
11771186
def reveal_type(__obj: _T) -> _T: ...
11781187
def assert_never(__arg: Never) -> Never: ...
1188+
def assert_type(__val: _T, __typ: Any) -> _T: ...
11791189

11801190
# Type constructors
11811191

0 commit comments

Comments
 (0)