Skip to content

Commit 970b8a6

Browse files
authored
Use async def instead of def ... -> Awaitable in typing (#7105)
1 parent 90f5422 commit 970b8a6

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

stdlib/types.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,15 @@ class AsyncGeneratorType(AsyncGenerator[_T_co, _T_contra]):
232232
ag_running: bool
233233
ag_code: CodeType
234234
def __aiter__(self) -> AsyncGeneratorType[_T_co, _T_contra]: ...
235-
def __anext__(self) -> Awaitable[_T_co]: ...
236-
def asend(self, __val: _T_contra) -> Awaitable[_T_co]: ...
235+
async def __anext__(self) -> _T_co: ...
236+
async def asend(self, __val: _T_contra) -> _T_co: ...
237237
@overload
238-
def athrow(
238+
async def athrow(
239239
self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ...
240-
) -> Awaitable[_T_co]: ...
240+
) -> _T_co: ...
241241
@overload
242-
def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> Awaitable[_T_co]: ...
243-
def aclose(self) -> Awaitable[None]: ...
242+
async def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ...
243+
async def aclose(self) -> None: ...
244244
if sys.version_info >= (3, 9):
245245
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
246246

stdlib/typing.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,24 +284,24 @@ class AsyncIterable(Protocol[_T_co]):
284284
@runtime_checkable
285285
class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
286286
@abstractmethod
287-
def __anext__(self) -> Awaitable[_T_co]: ...
287+
async def __anext__(self) -> _T_co: ...
288288
def __aiter__(self) -> AsyncIterator[_T_co]: ...
289289

290290
class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]):
291291
@abstractmethod
292-
def __anext__(self) -> Awaitable[_T_co]: ...
292+
async def __anext__(self) -> _T_co: ...
293293
@abstractmethod
294-
def asend(self, __value: _T_contra) -> Awaitable[_T_co]: ...
294+
async def asend(self, __value: _T_contra) -> _T_co: ...
295295
@overload
296296
@abstractmethod
297-
def athrow(
297+
async def athrow(
298298
self, __typ: Type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ...
299-
) -> Awaitable[_T_co]: ...
299+
) -> _T_co: ...
300300
@overload
301301
@abstractmethod
302-
def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> Awaitable[_T_co]: ...
302+
async def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ...
303303
@abstractmethod
304-
def aclose(self) -> Awaitable[None]: ...
304+
async def aclose(self) -> None: ...
305305
@abstractmethod
306306
def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ...
307307
@property

0 commit comments

Comments
 (0)