From 228f74d76a5df1b09fe0316d3eedd40cff285ec9 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Fri, 9 Oct 2020 21:25:33 -0700 Subject: [PATCH] io: loosen writelines type to iterable (#4642) This came up in https://github.com/python/mypy/pull/9275 Co-authored-by: hauntsaninja <> --- stdlib/3/io.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index 206f9345e..f904e976a 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -128,7 +128,7 @@ class TextIOBase(IOBase): def __next__(self) -> str: ... # type: ignore def detach(self) -> BinaryIO: ... def write(self, __s: str) -> int: ... - def writelines(self, __lines: List[str]) -> None: ... # type: ignore + def writelines(self, __lines: Iterable[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: ... @@ -166,7 +166,7 @@ class TextIOWrapper(TextIOBase, TextIO): def __enter__(self: _T) -> _T: ... def __iter__(self) -> Iterator[str]: ... # type: ignore def __next__(self) -> str: ... # type: ignore - def writelines(self, __lines: List[str]) -> None: ... # type: ignore + def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore def readline(self, __size: int = ...) -> str: ... # type: ignore def readlines(self, __hint: int = ...) -> List[str]: ... # type: ignore def seek(self, __cookie: int, __whence: int = ...) -> int: ...