188
188
PythonFuncType = Callable [[Any ], Any ]
189
189
190
190
# filenames and file-like-objects
191
- AnyStr_cov = TypeVar ("AnyStr_cov " , str , bytes , covariant = True )
192
- AnyStr_con = TypeVar ("AnyStr_con " , str , bytes , contravariant = True )
191
+ AnyStr_co = TypeVar ("AnyStr_co " , str , bytes , covariant = True )
192
+ AnyStr_contra = TypeVar ("AnyStr_contra " , str , bytes , contravariant = True )
193
193
194
194
195
195
class BaseBuffer (Protocol ):
@@ -212,14 +212,14 @@ def tell(self) -> int:
212
212
...
213
213
214
214
215
- class ReadBuffer (BaseBuffer , Protocol [AnyStr_cov ]):
216
- def read (self , __n : int = ...) -> AnyStr_cov :
215
+ class ReadBuffer (BaseBuffer , Protocol [AnyStr_co ]):
216
+ def read (self , __n : int = ...) -> AnyStr_co :
217
217
# for BytesIOWrapper, gzip.GzipFile, bz2.BZ2File
218
218
...
219
219
220
220
221
- class WriteBuffer (BaseBuffer , Protocol [AnyStr_con ]):
222
- def write (self , __b : AnyStr_con ) -> Any :
221
+ class WriteBuffer (BaseBuffer , Protocol [AnyStr_contra ]):
222
+ def write (self , __b : AnyStr_contra ) -> Any :
223
223
# for gzip.GzipFile, bz2.BZ2File
224
224
...
225
225
@@ -238,16 +238,16 @@ def truncate(self, size: int | None = ...) -> int:
238
238
...
239
239
240
240
241
- class ReadCsvBuffer (ReadBuffer [AnyStr_cov ], Protocol ):
242
- def __iter__ (self ) -> Iterator [AnyStr_cov ]:
241
+ class ReadCsvBuffer (ReadBuffer [AnyStr_co ], Protocol ):
242
+ def __iter__ (self ) -> Iterator [AnyStr_co ]:
243
243
# for engine=python
244
244
...
245
245
246
246
def fileno (self ) -> int :
247
247
# for _MMapWrapper
248
248
...
249
249
250
- def readline (self ) -> AnyStr_cov :
250
+ def readline (self ) -> AnyStr_co :
251
251
# for engine=python
252
252
...
253
253
0 commit comments