Skip to content

Commit

Permalink
pythongh-114281: Improve type hints in asyncio/staggered.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Jan 19, 2024
1 parent a34e4db commit 7206e41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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``.

0 comments on commit 7206e41

Please sign in to comment.