Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Lib/asyncio/staggered.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
__all__ = 'staggered_race',

import contextlib
import typing
from collections.abc import Awaitable, Callable, Iterable
from typing import Any

from . import events
from . import exceptions as exceptions_mod
Expand All @@ -12,14 +13,14 @@


async def staggered_race(
coro_fns: typing.Iterable[typing.Callable[[], typing.Awaitable]],
delay: typing.Optional[float],
coro_fns: Iterable[Callable[[], Awaitable[Any]]],
delay: float | None,
*,
loop: events.AbstractEventLoop = None,
) -> typing.Tuple[
typing.Any,
typing.Optional[int],
typing.List[typing.Optional[Exception]]
loop: events.AbstractEventLoop | None = None,
) -> tuple[
Any,
int | None,
list[Exception | None]
]:
"""Run coroutines with staggered start times and take the first to finish.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve type hints in ``Lib/asyncio/staggered.py``.