@@ -86,7 +86,7 @@ class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
86
86
def incrementaldecoder (self ) -> _IncrementalDecoder : ...
87
87
name : str
88
88
def __new__ (
89
- cls ,
89
+ cls : type [ Self ] ,
90
90
encode : _Encoder ,
91
91
decode : _Decoder ,
92
92
streamreader : _StreamReader | None = ...,
@@ -96,7 +96,7 @@ class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
96
96
name : str | None = ...,
97
97
* ,
98
98
_is_text_encoding : bool | None = ...,
99
- ) -> CodecInfo : ...
99
+ ) -> Self : ...
100
100
101
101
def getencoder (encoding : str ) -> _Encoder : ...
102
102
def getdecoder (encoding : str ) -> _Decoder : ...
@@ -189,7 +189,7 @@ class StreamWriter(Codec):
189
189
def __exit__ (self , typ : type [BaseException ] | None , exc : BaseException | None , tb : types .TracebackType | None ) -> None : ...
190
190
def __getattr__ (self , name : str , getattr : Callable [[str ], Any ] = ...) -> Any : ...
191
191
192
- class StreamReader (Codec ):
192
+ class StreamReader (Codec , Iterator [ str ] ):
193
193
errors : str
194
194
def __init__ (self , stream : IO [bytes ], errors : str = ...) -> None : ...
195
195
def read (self , size : int = ..., chars : int = ..., firstline : bool = ...) -> str : ...
@@ -198,7 +198,8 @@ class StreamReader(Codec):
198
198
def reset (self ) -> None : ...
199
199
def __enter__ (self : Self ) -> Self : ...
200
200
def __exit__ (self , typ : type [BaseException ] | None , exc : BaseException | None , tb : types .TracebackType | None ) -> None : ...
201
- def __iter__ (self ) -> Iterator [str ]: ...
201
+ def __iter__ (self : Self ) -> Self : ...
202
+ def __next__ (self ) -> str : ...
202
203
def __getattr__ (self , name : str , getattr : Callable [[str ], Any ] = ...) -> Any : ...
203
204
204
205
# Doesn't actually inherit from TextIO, but wraps a BinaryIO to provide text reading and writing
0 commit comments