use Self in async context managers (#5724)

This commit is contained in:
Akuli
2021-07-06 09:47:49 +03:00
committed by GitHub
parent ff2b92f340
commit 42247feefb
3 changed files with 7 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Self
from types import CodeType, FrameType, TracebackType, coroutine
from typing import Any, Coroutine, Generator, Generic, Iterator, Optional, Type, TypeVar, Union
@@ -8,7 +9,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True)
class AsyncBase(Generic[_T]):
def __init__(self, file: str, loop: Any, executor: Any) -> None: ...
async def __aiter__(self) -> Iterator[_T]: ...
async def __aiter__(self: Self) -> Self: ...
async def __anext__(self) -> _T: ...
class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]):