mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add _loop, _tasks, and _on_task_done to the stub for asyncio.TaskGroup (#10612)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user