@@ -128,8 +128,21 @@ if sys.version_info >= (3, 11):
128
128
"walktree" ,
129
129
]
130
130
131
+ if sys .version_info >= (3 , 12 ):
132
+ __all__ += [
133
+ "markcoroutinefunction" ,
134
+ "AGEN_CLOSED" ,
135
+ "AGEN_CREATED" ,
136
+ "AGEN_RUNNING" ,
137
+ "AGEN_SUSPENDED" ,
138
+ "getasyncgenlocals" ,
139
+ "getasyncgenstate" ,
140
+ "BufferFlags" ,
141
+ ]
142
+
131
143
_P = ParamSpec ("_P" )
132
144
_T = TypeVar ("_T" )
145
+ _F = TypeVar ("_F" , bound = Callable [..., Any ])
133
146
_T_cont = TypeVar ("_T_cont" , contravariant = True )
134
147
_V_cont = TypeVar ("_V_cont" , contravariant = True )
135
148
@@ -184,6 +197,9 @@ def isclass(object: object) -> TypeGuard[type[Any]]: ...
184
197
def ismethod (object : object ) -> TypeGuard [MethodType ]: ...
185
198
def isfunction (object : object ) -> TypeGuard [FunctionType ]: ...
186
199
200
+ if sys .version_info >= (3 , 12 ):
201
+ def markcoroutinefunction (func : _F ) -> _F : ...
202
+
187
203
if sys .version_info >= (3 , 8 ):
188
204
@overload
189
205
def isgeneratorfunction (obj : Callable [..., Generator [Any , Any , Any ]]) -> bool : ...
@@ -360,6 +376,17 @@ class _ParameterKind(enum.IntEnum):
360
376
@property
361
377
def description (self ) -> str : ...
362
378
379
+ if sys .version_info >= (3 , 12 ):
380
+ AGEN_CREATED : Literal ["AGEN_CREATED" ]
381
+ AGEN_RUNNING : Literal ["AGEN_RUNNING" ]
382
+ AGEN_SUSPENDED : Literal ["AGEN_SUSPENDED" ]
383
+ AGEN_CLOSED : Literal ["AGEN_CLOSED" ]
384
+
385
+ def getasyncgenstate (
386
+ agen : AsyncGenerator [Any , Any ]
387
+ ) -> Literal ["AGEN_CREATED" , "AGEN_RUNNING" , "AGEN_SUSPENDED" , "AGEN_CLOSED" ]: ...
388
+ def getasyncgenlocals (agen : AsyncGeneratorType [Any , Any ]) -> dict [str , Any ]: ...
389
+
363
390
class Parameter :
364
391
def __init__ (self , name : str , kind : _ParameterKind , * , default : Any = ..., annotation : Any = ...) -> None : ...
365
392
empty = _empty
0 commit comments