diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index 68564e89a..47fb0d2b6 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -145,7 +145,7 @@ class TextIOBase(IOBase): newlines: Union[str, Tuple[str, ...], None] def __iter__(self) -> Iterator[str]: ... # type: ignore def __next__(self) -> str: ... # type: ignore - def detach(self) -> IOBase: ... + def detach(self) -> BinaryIO: ... def write(self, s: str) -> int: ... def writelines(self, __lines: List[str]) -> None: ... # type: ignore def readline(self, size: int = ...) -> str: ... # type: ignore @@ -164,13 +164,15 @@ class TextIOWrapper(TextIO): # -> None: ... def __init__( self, - buffer: IO[bytes], + buffer: BinaryIO, encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., line_buffering: bool = ..., write_through: bool = ... ) -> None: ... + @property + def buffer(self) -> BinaryIO: ... if sys.version_info >= (3, 7): def reconfigure( self, @@ -205,7 +207,7 @@ class TextIOWrapper(TextIO): def __iter__(self) -> Iterator[str]: ... def __next__(self) -> str: ... def __enter__(self) -> TextIO: ... - def detach(self) -> IOBase: ... + def detach(self) -> BinaryIO: ... def write(self, __text: str) -> int: ... def readline(self, __size: int = ...) -> str: ... def read(self, __size: Optional[int] = ...) -> str: ...