From ff9f5a69f5d46af08f9c46193a01fab6835e4970 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 7 Oct 2022 02:48:39 +0200 Subject: [PATCH] Use general type ignore for asyncio.Task --- stdlib/asyncio/tasks.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 27d80be8d8f5..67581eb6a5ad 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -266,11 +266,11 @@ else: ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> _T: ... -# pyright complains that a subclass of an invariant class shouldn't be covariant. +# mypy and pyright complain that a subclass of an invariant class shouldn't be covariant. # While this is true in general, here it's sort-of okay to have a covariant subclass, # since the only reason why `asyncio.Future` is invariant is the `set_result()` method, # and `asyncio.Task.set_result()` always raises. -class Task(Future[_T_co], Generic[_T_co]): # pyright: ignore[reportGeneralTypeIssues] +class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] if sys.version_info >= (3, 8): def __init__( self,