@@ -73,33 +73,28 @@ class FileIO(RawIOBase, _RawIOBase, BinaryIO): # type: ignore[misc] # incompat
73
73
) -> None : ...
74
74
@property
75
75
def closefd (self ) -> bool : ...
76
- def __enter__ (self ) -> Self : ...
77
76
78
77
class BytesIO (BufferedIOBase , _BufferedIOBase , BinaryIO ): # type: ignore[misc] # incompatible definitions of methods in the base classes
79
78
def __init__ (self , initial_bytes : ReadableBuffer = ...) -> None : ...
80
79
# BytesIO does not contain a "name" field. This workaround is necessary
81
80
# to allow BytesIO sub-classes to add this field, as it is defined
82
81
# as a read-only property on IO[].
83
82
name : Any
84
- def __enter__ (self ) -> Self : ...
85
83
def getvalue (self ) -> bytes : ...
86
84
def getbuffer (self ) -> memoryview : ...
87
85
def read1 (self , size : int | None = - 1 , / ) -> bytes : ...
88
86
89
87
class BufferedReader (BufferedIOBase , _BufferedIOBase , BinaryIO ): # type: ignore[misc] # incompatible definitions of methods in the base classes
90
88
raw : RawIOBase
91
- def __enter__ (self ) -> Self : ...
92
89
def __init__ (self , raw : RawIOBase , buffer_size : int = ...) -> None : ...
93
90
def peek (self , size : int = 0 , / ) -> bytes : ...
94
91
95
92
class BufferedWriter (BufferedIOBase , _BufferedIOBase , BinaryIO ): # type: ignore[misc] # incompatible definitions of writelines in the base classes
96
93
raw : RawIOBase
97
- def __enter__ (self ) -> Self : ...
98
94
def __init__ (self , raw : RawIOBase , buffer_size : int = ...) -> None : ...
99
95
def write (self , buffer : ReadableBuffer , / ) -> int : ...
100
96
101
97
class BufferedRandom (BufferedReader , BufferedWriter , BufferedIOBase , _BufferedIOBase ): # type: ignore[misc] # incompatible definitions of methods in the base classes
102
- def __enter__ (self ) -> Self : ...
103
98
def seek (self , target : int , whence : int = 0 , / ) -> int : ... # stubtest needs this
104
99
105
100
class BufferedRWPair (BufferedIOBase , _BufferedIOBase ):
@@ -159,8 +154,6 @@ class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # t
159
154
@property
160
155
def buffer (self ) -> _BufferT_co : ... # type: ignore[override]
161
156
@property
162
- def closed (self ) -> bool : ...
163
- @property
164
157
def line_buffering (self ) -> bool : ...
165
158
@property
166
159
def write_through (self ) -> bool : ...
@@ -173,13 +166,7 @@ class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # t
173
166
line_buffering : bool | None = None ,
174
167
write_through : bool | None = None ,
175
168
) -> 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]
181
169
def readline (self , size : int = - 1 , / ) -> str : ... # type: ignore[override]
182
- def readlines (self , hint : int = - 1 , / ) -> list [str ]: ... # type: ignore[override]
183
170
# Equals the "buffer" argument passed in to the constructor.
184
171
def detach (self ) -> _BufferT_co : ... # type: ignore[override]
185
172
# TextIOWrapper's version of seek only supports a limited subset of
0 commit comments