From 701f970c6f707ffa0e36d49f9d077b4efc99807c Mon Sep 17 00:00:00 2001 From: Siva Chandra Date: Tue, 30 Oct 2018 14:44:18 -0700 Subject: [PATCH] Add overrides for the methods 'readlines' and 'writelines' in TextIOBase. (#2551) Without the overrides, MRO will pick the methods in IOBase which have the wrong signatures. --- stdlib/3/io.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index ba0a80a38..c9060b043 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -141,7 +141,9 @@ class TextIOBase(IOBase): def __next__(self) -> str: ... # type: ignore def detach(self) -> IOBase: ... def write(self, s: str) -> int: ... + def writelines(self, lines: List[str]) -> None: ... # type: ignore def readline(self, size: int = ...) -> str: ... # type: ignore + def readlines(self, hint: int = ...) -> List[str]: ... # type: ignore def read(self, size: Optional[int] = ...) -> str: ... def seek(self, offset: int, whence: int = ...) -> int: ... def tell(self) -> int: ...