Skip to content

Commit 93075bf

Browse files
authored
Use general type ignore for asyncio.Task (#8861)
1 parent 9733901 commit 93075bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/asyncio/tasks.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,11 @@ else:
266266
) -> tuple[set[Task[_T]], set[Task[_T]]]: ...
267267
async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> _T: ...
268268

269-
# pyright complains that a subclass of an invariant class shouldn't be covariant.
269+
# mypy and pyright complain that a subclass of an invariant class shouldn't be covariant.
270270
# While this is true in general, here it's sort-of okay to have a covariant subclass,
271271
# since the only reason why `asyncio.Future` is invariant is the `set_result()` method,
272272
# and `asyncio.Task.set_result()` always raises.
273-
class Task(Future[_T_co], Generic[_T_co]): # pyright: ignore[reportGeneralTypeIssues]
273+
class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var]
274274
if sys.version_info >= (3, 8):
275275
def __init__(
276276
self,

0 commit comments

Comments
 (0)