massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / aiofiles / aiofiles / base.pyi
1 from _typeshed import Self
2 from types import CodeType, FrameType, TracebackType, coroutine
3 from typing import Any, Coroutine, Generator, Generic, Iterator, Type, TypeVar
4
5 _T = TypeVar("_T")
6 _T_co = TypeVar("_T_co", covariant=True)
7 _V_co = TypeVar("_V_co", covariant=True)
8 _T_contra = TypeVar("_T_contra", contravariant=True)
9
10 class AsyncBase(Generic[_T]):
11     def __init__(self, file: str, loop: Any, executor: Any) -> None: ...
12     def __aiter__(self: Self) -> Self: ...
13     async def __anext__(self) -> _T: ...
14
15 class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]):
16     def __init__(self, coro: Coroutine[_T_co, _T_contra, _V_co]) -> None: ...
17     def send(self, value: _T_contra) -> _T_co: ...
18     def throw(self, typ: Type[BaseException], val: BaseException | object = ..., tb: TracebackType | None = ...) -> _T_co: ...
19     def close(self) -> None: ...
20     @property
21     def gi_frame(self) -> FrameType: ...
22     @property
23     def gi_running(self) -> bool: ...
24     @property
25     def gi_code(self) -> CodeType: ...
26     def __next__(self) -> _T_co: ...
27     @coroutine
28     def __iter__(self) -> Iterator[Coroutine[_T_co, _T_contra, _V_co]]: ...
29     def __await__(self) -> Generator[Any, None, _V_co]: ...
30     async def __anext__(self) -> _V_co: ...
31     async def __aenter__(self) -> _V_co: ...
32     async def __aexit__(
33         self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
34     ) -> None: ...