Skip to content

Commit 42ebc89

Browse files
authored
remove redundant methods from _io classes (#12761)
1 parent 4b6869d commit 42ebc89

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

stdlib/_io.pyi

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,33 +73,28 @@ class FileIO(RawIOBase, _RawIOBase, BinaryIO): # type: ignore[misc] # incompat
7373
) -> None: ...
7474
@property
7575
def closefd(self) -> bool: ...
76-
def __enter__(self) -> Self: ...
7776

7877
class BytesIO(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
7978
def __init__(self, initial_bytes: ReadableBuffer = ...) -> None: ...
8079
# BytesIO does not contain a "name" field. This workaround is necessary
8180
# to allow BytesIO sub-classes to add this field, as it is defined
8281
# as a read-only property on IO[].
8382
name: Any
84-
def __enter__(self) -> Self: ...
8583
def getvalue(self) -> bytes: ...
8684
def getbuffer(self) -> memoryview: ...
8785
def read1(self, size: int | None = -1, /) -> bytes: ...
8886

8987
class BufferedReader(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
9088
raw: RawIOBase
91-
def __enter__(self) -> Self: ...
9289
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
9390
def peek(self, size: int = 0, /) -> bytes: ...
9491

9592
class BufferedWriter(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
9693
raw: RawIOBase
97-
def __enter__(self) -> Self: ...
9894
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
9995
def write(self, buffer: ReadableBuffer, /) -> int: ...
10096

10197
class BufferedRandom(BufferedReader, BufferedWriter, BufferedIOBase, _BufferedIOBase): # type: ignore[misc] # incompatible definitions of methods in the base classes
102-
def __enter__(self) -> Self: ...
10398
def seek(self, target: int, whence: int = 0, /) -> int: ... # stubtest needs this
10499

105100
class BufferedRWPair(BufferedIOBase, _BufferedIOBase):
@@ -159,8 +154,6 @@ class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # t
159154
@property
160155
def buffer(self) -> _BufferT_co: ... # type: ignore[override]
161156
@property
162-
def closed(self) -> bool: ...
163-
@property
164157
def line_buffering(self) -> bool: ...
165158
@property
166159
def write_through(self) -> bool: ...
@@ -173,13 +166,7 @@ class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # t
173166
line_buffering: bool | None = None,
174167
write_through: bool | None = None,
175168
) -> None: ...
176-
# These are inherited from TextIOBase, but must exist in the stub to satisfy mypy.
177-
def __enter__(self) -> Self: ...
178-
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
179-
def __next__(self) -> str: ... # type: ignore[override]
180-
def writelines(self, lines: Iterable[str], /) -> None: ... # type: ignore[override]
181169
def readline(self, size: int = -1, /) -> str: ... # type: ignore[override]
182-
def readlines(self, hint: int = -1, /) -> list[str]: ... # type: ignore[override]
183170
# Equals the "buffer" argument passed in to the constructor.
184171
def detach(self) -> _BufferT_co: ... # type: ignore[override]
185172
# TextIOWrapper's version of seek only supports a limited subset of

0 commit comments

Comments
 (0)