stdlib: Add defaults for positional-only parameters (#9655)

This commit is contained in:
Alex Waygood
2023-02-01 21:44:08 +00:00
committed by GitHub
parent 35172c7aab
commit 1d7dda7fa1
30 changed files with 159 additions and 155 deletions

View File

@@ -61,7 +61,7 @@ class IOBase(metaclass=abc.ABCMeta):
def isatty(self) -> bool: ...
def readable(self) -> bool: ...
read: Callable[..., Any]
def readlines(self, __hint: int = ...) -> list[bytes]: ...
def readlines(self, __hint: int = -1) -> list[bytes]: ...
def seek(self, __offset: int, __whence: int = ...) -> int: ...
def seekable(self) -> bool: ...
def tell(self) -> int: ...
@@ -69,7 +69,7 @@ class IOBase(metaclass=abc.ABCMeta):
def writable(self) -> bool: ...
write: Callable[..., Any]
def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ...
def readline(self, __size: int | None = ...) -> bytes: ...
def readline(self, __size: int | None = -1) -> bytes: ...
def __del__(self) -> None: ...
@property
def closed(self) -> bool: ...
@@ -79,7 +79,7 @@ class RawIOBase(IOBase):
def readall(self) -> bytes: ...
def readinto(self, __buffer: WriteableBuffer) -> int | None: ...
def write(self, __b: ReadableBuffer) -> int | None: ...
def read(self, __size: int = ...) -> bytes | None: ...
def read(self, __size: int = -1) -> bytes | None: ...
class BufferedIOBase(IOBase):
raw: RawIOBase # This is not part of the BufferedIOBase API and may not exist on some implementations.
@@ -99,7 +99,7 @@ class FileIO(RawIOBase, BinaryIO):
@property
def closefd(self) -> bool: ...
def write(self, __b: ReadableBuffer) -> int: ...
def read(self, __size: int = ...) -> bytes: ...
def read(self, __size: int = -1) -> bytes: ...
def __enter__(self: Self) -> Self: ...
class BytesIO(BufferedIOBase, BinaryIO):
@@ -111,12 +111,12 @@ class BytesIO(BufferedIOBase, BinaryIO):
def __enter__(self: Self) -> Self: ...
def getvalue(self) -> bytes: ...
def getbuffer(self) -> memoryview: ...
def read1(self, __size: int | None = ...) -> bytes: ...
def read1(self, __size: int | None = -1) -> bytes: ...
class BufferedReader(BufferedIOBase, BinaryIO):
def __enter__(self: Self) -> Self: ...
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
def peek(self, __size: int = ...) -> bytes: ...
def peek(self, __size: int = 0) -> bytes: ...
class BufferedWriter(BufferedIOBase, BinaryIO):
def __enter__(self: Self) -> Self: ...
@@ -125,7 +125,7 @@ class BufferedWriter(BufferedIOBase, BinaryIO):
class BufferedRandom(BufferedReader, BufferedWriter):
def __enter__(self: Self) -> Self: ...
def seek(self, __target: int, __whence: int = ...) -> int: ... # stubtest needs this
def seek(self, __target: int, __whence: int = 0) -> int: ... # stubtest needs this
class BufferedRWPair(BufferedIOBase):
def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ...
@@ -141,7 +141,7 @@ class TextIOBase(IOBase):
def write(self, __s: str) -> int: ...
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override]
def readline(self, __size: int = ...) -> str: ... # type: ignore[override]
def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override]
def readlines(self, __hint: int = -1) -> list[str]: ... # type: ignore[override]
def read(self, __size: int | None = ...) -> str: ...
class TextIOWrapper(TextIOBase, TextIO):
@@ -176,9 +176,9 @@ class TextIOWrapper(TextIOBase, TextIO):
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
def __next__(self) -> str: ... # type: ignore[override]
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override]
def readline(self, __size: int = ...) -> str: ... # type: ignore[override]
def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override]
def seek(self, __cookie: int, __whence: int = ...) -> int: ... # stubtest needs this
def readline(self, __size: int = -1) -> str: ... # type: ignore[override]
def readlines(self, __hint: int = -1) -> list[str]: ... # type: ignore[override]
def seek(self, __cookie: int, __whence: int = 0) -> int: ... # stubtest needs this
class StringIO(TextIOWrapper):
def __init__(self, initial_value: str | None = ..., newline: str | None = ...) -> None: ...