Add _loop, _tasks, and _on_task_done to the stub for asyncio.TaskGroup (#10612)

This commit is contained in:
Joseph Courtney
2023-08-28 11:02:40 -04:00
committed by GitHub
parent 03e65e1f1a
commit 2cd8f26e66

View File

@@ -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: ...