Visitar URL original
gh-114281: Remove incorrect type hints from `asyncio.staggered` by sobolevn · Pull Request #114282 · python/cpython · GitHub
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
Next Next commit
gh-114281: Improve type hints in asyncio/staggered.py
  • Loading branch information
sobolevn committed Jan 19, 2024
commit 7206e4175ead4a82b335a8b90b970e8b3453ea14
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``.
Comment thread
sobolevn marked this conversation as resolved.
Outdated