Skip to content

Commit

Permalink
Fix return type annotation for asyncio.Task.get_coro() (#12445)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity authored Jul 27, 2024
1 parent 1a8c7eb commit d2ccc9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion stdlib/asyncio/tasks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportIn
self, coro: _TaskCompatibleCoro[_T_co], *, loop: AbstractEventLoop = ..., name: str | None = ...
) -> None: ...

def get_coro(self) -> _TaskCompatibleCoro[_T_co]: ...
if sys.version_info >= (3, 12):
def get_coro(self) -> _TaskCompatibleCoro[_T_co] | None: ...
else:
def get_coro(self) -> _TaskCompatibleCoro[_T_co]: ...

def get_name(self) -> str: ...
def set_name(self, value: object, /) -> None: ...
if sys.version_info >= (3, 12):
Expand Down

0 comments on commit d2ccc9a

Please sign in to comment.