@@ -53,9 +53,6 @@ def runtime_checkable(cls: _TC) -> _TC: ...
53
53
# This alias for above is kept here for backwards compatibility.
54
54
runtime = runtime_checkable
55
55
Final : _SpecialForm
56
- Self : _SpecialForm
57
- Required : _SpecialForm
58
- NotRequired : _SpecialForm
59
56
60
57
def final (f : _F ) -> _F : ...
61
58
@@ -103,7 +100,7 @@ class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
103
100
@abc .abstractmethod
104
101
def __index__ (self ) -> int : ...
105
102
106
- # PEP 612 support for Python < 3.9
103
+ # New things in 3.10
107
104
if sys .version_info >= (3 , 10 ):
108
105
from typing import (
109
106
Concatenate as Concatenate ,
@@ -137,3 +134,24 @@ else:
137
134
TypeAlias : _SpecialForm
138
135
TypeGuard : _SpecialForm
139
136
def is_typeddict (tp : object ) -> bool : ...
137
+
138
+ # New things in 3.11
139
+ if sys .version_info >= (3 , 11 ):
140
+ from typing import Never as Never , Self as Self , assert_never as assert_never , reveal_type as reveal_type
141
+ else :
142
+ Self : _SpecialForm
143
+ Never : _SpecialForm
144
+ def reveal_type (__obj : _T ) -> _T : ...
145
+ def assert_never (__arg : NoReturn ) -> NoReturn : ...
146
+
147
+ # Experimental (hopefully these will be in 3.11)
148
+ Required : _SpecialForm
149
+ NotRequired : _SpecialForm
150
+
151
+ def dataclass_transform (
152
+ * ,
153
+ eq_default : bool = ...,
154
+ order_default : bool = ...,
155
+ kw_only_default : bool = ...,
156
+ field_descriptors : tuple [type [Any ] | Callable [..., Any ], ...] = ...,
157
+ ) -> Callable [[_T ], _T ]: ...
0 commit comments