From 2cd8f26e6671724351dd8d2b92f22738d8e85df8 Mon Sep 17 00:00:00 2001 From: Joseph Courtney Date: Mon, 28 Aug 2023 11:02:40 -0400 Subject: [PATCH] Add _loop, _tasks, and _on_task_done to the stub for asyncio.TaskGroup (#10612) --- stdlib/asyncio/taskgroups.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/asyncio/taskgroups.pyi b/stdlib/asyncio/taskgroups.pyi index 47d9bb2f6..aec3f1127 100644 --- a/stdlib/asyncio/taskgroups.pyi +++ b/stdlib/asyncio/taskgroups.pyi @@ -1,10 +1,11 @@ import sys from contextvars import Context from types import TracebackType -from typing import TypeVar +from typing import Any, TypeVar from typing_extensions import Self from . import _CoroutineLike +from .events import AbstractEventLoop from .tasks import Task if sys.version_info >= (3, 12): @@ -15,6 +16,10 @@ else: _T = TypeVar("_T") class TaskGroup: + _loop: AbstractEventLoop | None + _tasks: set[Task[Any]] + async def __aenter__(self) -> Self: ... async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ... def create_task(self, coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None) -> Task[_T]: ... + def _on_task_done(self, task: Task[object]) -> None: ...