From d0754cfe599c66cb2c0e4358246b9a60c84bd099 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 20 Jan 2024 19:49:48 +0300 Subject: [PATCH] gh-114281: Remove incorrect type hints from `asyncio.staggered` (#114282) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Lib/asyncio/staggered.py | 12 +----------- .../2024-01-19-12-05-22.gh-issue-114281.H5JQe4.rst | 3 +++ 2 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2024-01-19-12-05-22.gh-issue-114281.H5JQe4.rst diff --git a/Lib/asyncio/staggered.py b/Lib/asyncio/staggered.py index 451a53a16f38316..e180cde0243b154 100644 --- a/Lib/asyncio/staggered.py +++ b/Lib/asyncio/staggered.py @@ -3,7 +3,6 @@ __all__ = 'staggered_race', import contextlib -import typing from . import events from . import exceptions as exceptions_mod @@ -11,16 +10,7 @@ from . import tasks -async def staggered_race( - coro_fns: typing.Iterable[typing.Callable[[], typing.Awaitable]], - delay: typing.Optional[float], - *, - loop: events.AbstractEventLoop = None, -) -> typing.Tuple[ - typing.Any, - typing.Optional[int], - typing.List[typing.Optional[Exception]] -]: +async def staggered_race(coro_fns, delay, *, loop=None): """Run coroutines with staggered start times and take the first to finish. This method takes an iterable of coroutine functions. The first one is diff --git a/Misc/NEWS.d/next/Library/2024-01-19-12-05-22.gh-issue-114281.H5JQe4.rst b/Misc/NEWS.d/next/Library/2024-01-19-12-05-22.gh-issue-114281.H5JQe4.rst new file mode 100644 index 000000000000000..36c54e8faf214c2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-01-19-12-05-22.gh-issue-114281.H5JQe4.rst @@ -0,0 +1,3 @@ +Remove type hints from ``Lib/asyncio/staggered.py``. +The annotations in the `typeshed `__ +project should be used instead.