Fix return annotations of several methods that return self at runtime (#7070)

This commit is contained in:
Alex Waygood
2022-01-29 01:37:49 +00:00
committed by GitHub
parent 749d3db815
commit 33ecb68603
8 changed files with 19 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
import sys
from _typeshed import StrPath
from _typeshed import Self, StrPath
from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Optional
from . import events, protocols, transports
@@ -117,7 +117,7 @@ class StreamWriter:
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
async def drain(self) -> None: ...
class StreamReader:
class StreamReader(AsyncIterator[bytes]):
def __init__(self, limit: int = ..., loop: events.AbstractEventLoop | None = ...) -> None: ...
def exception(self) -> Exception: ...
def set_exception(self, exc: Exception) -> None: ...
@@ -129,5 +129,5 @@ class StreamReader:
async def readuntil(self, separator: bytes = ...) -> bytes: ...
async def read(self, n: int = ...) -> bytes: ...
async def readexactly(self, n: int) -> bytes: ...
def __aiter__(self) -> AsyncIterator[bytes]: ...
def __aiter__(self: Self) -> Self: ...
async def __anext__(self) -> bytes: ...