Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Self typevar for __aenter__
  • Loading branch information
gvanrossum committed Feb 16, 2022
commit 2df795b4ef9ed3cc8425e24ae8ae09aaf2eeaf62
3 changes: 2 additions & 1 deletion stdlib/asyncio/taskgroups.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from types import TracebackType
from typing import Any, Coroutine, Generator, TypeVar
from _typeshed import Self

from .tasks import Task

Expand All @@ -10,6 +11,6 @@ _T = TypeVar("_T")
class TaskGroup:
def __init__(self, *, name: str | None = ...) -> None: ...
def get_name(self) -> str: ...
async def __aenter__(self) -> TaskGroup: ...
async def __aenter__(self: Self) -> Self: ...
async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ...
def create_task(self, coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T]) -> Task[_T]: ...