diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index d835219dd..4a79e7b60 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -3,6 +3,7 @@ from typing import ( ) import builtins import codecs +import sys from mmap import mmap from types import TracebackType from typing import TypeVar @@ -102,7 +103,7 @@ class BytesIO(BinaryIO): # TODO should be the next line instead # def writelines(self, lines: List[Union[bytes, bytearray]]) -> None: ... def writelines(self, lines: Any) -> None: ... - def readline(self, size: int = ...) -> bytes: ... + def readline(self, __size: Optional[int] = ...) -> bytes: ... def __del__(self) -> None: ... closed: bool # copied from BufferedIOBase @@ -111,7 +112,10 @@ class BytesIO(BinaryIO): def write(self, b: Union[bytes, bytearray]) -> int: ... def readinto1(self, b: _bytearray_like) -> int: ... def read(self, size: Optional[int] = ...) -> bytes: ... - def read1(self, size: int = ...) -> bytes: ... + if sys.version_info >= (3, 7): + def read1(self, __size: Optional[int] = ...) -> bytes: ... + else: + def read1(self, __size: Optional[int]) -> bytes: ... class BufferedReader(BufferedIOBase): def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...