Skip to content

Commit bbd8c77

Browse files
authored
Use "async def" in asyncio/tasks.pyi (#6783)
1 parent 03861b5 commit bbd8c77

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

stdlib/asyncio/tasks.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,27 +230,27 @@ def run_coroutine_threadsafe(coro: _FutureT[_T], loop: AbstractEventLoop) -> con
230230

231231
if sys.version_info >= (3, 10):
232232
def shield(arg: _FutureT[_T]) -> Future[_T]: ...
233-
def sleep(delay: float, result: _T = ...) -> Future[_T]: ...
233+
async def sleep(delay: float, result: _T = ...) -> _T: ...
234234
@overload
235-
def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> Future[tuple[set[_FT], set[_FT]]]: ... # type: ignore[misc]
235+
async def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc]
236236
@overload
237-
def wait(
237+
async def wait(
238238
fs: Iterable[Awaitable[_T]], *, timeout: float | None = ..., return_when: str = ...
239-
) -> Future[tuple[set[Task[_T]], set[Task[_T]]]]: ...
240-
def wait_for(fut: _FutureT[_T], timeout: float | None) -> Future[_T]: ...
239+
) -> tuple[set[Task[_T]], set[Task[_T]]]: ...
240+
async def wait_for(fut: _FutureT[_T], timeout: float | None) -> _T: ...
241241

242242
else:
243243
def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
244-
def sleep(delay: float, result: _T = ..., *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
244+
async def sleep(delay: float, result: _T = ..., *, loop: AbstractEventLoop | None = ...) -> _T: ...
245245
@overload
246-
def wait( # type: ignore[misc]
246+
async def wait( # type: ignore[misc]
247247
fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...
248-
) -> Future[tuple[set[_FT], set[_FT]]]: ...
248+
) -> tuple[set[_FT], set[_FT]]: ...
249249
@overload
250-
def wait(
250+
async def wait(
251251
fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...
252-
) -> Future[tuple[set[Task[_T]], set[Task[_T]]]]: ...
253-
def wait_for(fut: _FutureT[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
252+
) -> tuple[set[Task[_T]], set[Task[_T]]]: ...
253+
async def wait_for(fut: _FutureT[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> _T: ...
254254

255255
class Task(Future[_T], Generic[_T]):
256256
if sys.version_info >= (3, 8):

0 commit comments

Comments
 (0)