Fix return types in codecs (#7199)

This commit is contained in:
Alex Waygood
2022-02-14 13:03:58 +00:00
committed by GitHub
parent 7682ae957a
commit f3ad0179f8

View File

@@ -217,12 +217,10 @@ class StreamReaderWriter(TextIO):
def readlines(self, sizehint: int | None = ...) -> list[str]: ...
def __next__(self) -> str: ...
def __iter__(self: Self) -> Self: ...
# This actually returns None, but that's incompatible with the supertype
def write(self, data: str) -> int: ...
def write(self, data: str) -> None: ... # type: ignore[override]
def writelines(self, list: Iterable[str]) -> None: ...
def reset(self) -> None: ...
# Same as write()
def seek(self, offset: int, whence: int = ...) -> int: ...
def seek(self, offset: int, whence: int = ...) -> None: ... # type: ignore[override]
def __enter__(self: Self) -> Self: ...
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __getattr__(self, name: str) -> Any: ...
@@ -253,15 +251,15 @@ class StreamRecoder(BinaryIO):
def readlines(self, sizehint: int | None = ...) -> list[bytes]: ...
def __next__(self) -> bytes: ...
def __iter__(self: Self) -> Self: ...
def write(self, data: bytes) -> int: ...
def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore # it's supposed to return None
def write(self, data: bytes) -> None: ... # type: ignore[override]
def writelines(self, list: Iterable[bytes]) -> None: ...
def reset(self) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ...
def seek(self, offset: int, whence: int = ...) -> None: ... # type: ignore[override]
# These methods don't actually exist directly, but they are needed to satisfy the BinaryIO
# interface. At runtime, they are delegated through __getattr__.
def seek(self, offset: int, whence: int = ...) -> int: ...
def close(self) -> None: ...
def fileno(self) -> int: ...
def flush(self) -> None: ...