File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ class BytesIO(_BufferedIOBase):
82
82
def __init__ (self , initial_bytes : bytes = ...) -> None : ...
83
83
def __setstate__ (self , tuple ) -> None : ...
84
84
def __getstate__ (self ) -> tuple : ...
85
+ # BytesIO does not contain a "name" field. This workaround is necessary
86
+ # to allow BytesIO sub-classes to add this field, as it is defined
87
+ # as a read-only property on IO[].
88
+ name : Any
85
89
def getvalue (self ) -> bytes : ...
86
90
def write (self , s : bytes ) -> int : ...
87
91
def writelines (self , lines : Iterable [bytes ]) -> None : ...
@@ -148,6 +152,10 @@ class StringIO(_TextIOBase):
148
152
newline : Optional [unicode ] = ...) -> None : ...
149
153
def __setstate__ (self , state : tuple ) -> None : ...
150
154
def __getstate__ (self ) -> tuple : ...
155
+ # StringIO does not contain a "name" field. This workaround is necessary
156
+ # to allow StringIO sub-classes to add this field, as it is defined
157
+ # as a read-only property on IO[].
158
+ name : Any
151
159
def getvalue (self ) -> unicode : ...
152
160
153
161
class TextIOWrapper (_TextIOBase ):
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ class FileIO(RawIOBase):
98
98
# TODO should extend from BufferedIOBase
99
99
class BytesIO (BinaryIO ):
100
100
def __init__ (self , initial_bytes : bytes = ...) -> None : ...
101
+ # BytesIO does not contain a "name" field. This workaround is necessary
102
+ # to allow BytesIO sub-classes to add this field, as it is defined
103
+ # as a read-only property on IO[].
104
+ name : Any
101
105
def getvalue (self ) -> bytes : ...
102
106
if sys .version_info >= (3 , 2 ):
103
107
def getbuffer (self ) -> memoryview : ...
@@ -251,7 +255,10 @@ class TextIOWrapper(TextIO):
251
255
class StringIO (TextIOWrapper ):
252
256
def __init__ (self , initial_value : str = ...,
253
257
newline : Optional [str ] = ...) -> None : ...
254
- name = ... # type: str
258
+ # StringIO does not contain a "name" field. This workaround is necessary
259
+ # to allow StringIO sub-classes to add this field, as it is defined
260
+ # as a read-only property on IO[].
261
+ name : Any
255
262
def getvalue (self ) -> str : ...
256
263
def __enter__ (self ) -> 'StringIO' : ...
257
264
You can’t perform that action at this time.
0 commit comments