Add mypy error codes to type: ignores, remove unused ignores (#7504)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex Waygood
2022-03-19 13:10:00 +00:00
committed by GitHub
parent 4308915e06
commit 340c6c97ed
67 changed files with 159 additions and 150 deletions

View File

@@ -108,7 +108,7 @@ class BufferedIOBase(IOBase):
def read(self, __size: int | None = ...) -> bytes: ...
def read1(self, __size: int = ...) -> bytes: ...
class FileIO(RawIOBase, BinaryIO): # type: ignore # argument disparities between the base classes
class FileIO(RawIOBase, BinaryIO):
mode: str
name: StrOrBytesPath | int # type: ignore[assignment]
def __init__(
@@ -120,7 +120,7 @@ class FileIO(RawIOBase, BinaryIO): # type: ignore # argument disparities betwee
def read(self, __size: int = ...) -> bytes: ...
def __enter__(self: Self) -> Self: ...
class BytesIO(BufferedIOBase, BinaryIO): # type: ignore # argument disparities between the base classes
class BytesIO(BufferedIOBase, BinaryIO):
def __init__(self, initial_bytes: bytes = ...) -> None: ...
# BytesIO does not contain a "name" field. This workaround is necessary
# to allow BytesIO sub-classes to add this field, as it is defined
@@ -134,7 +134,7 @@ class BytesIO(BufferedIOBase, BinaryIO): # type: ignore # argument disparities
else:
def read1(self, __size: int | None) -> bytes: ... # type: ignore[override]
class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore # argument disparities between base classes
class BufferedReader(BufferedIOBase, BinaryIO):
def __enter__(self: Self) -> Self: ...
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
def peek(self, __size: int = ...) -> bytes: ...
@@ -143,7 +143,7 @@ class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore # argument dispa
else:
def read1(self, __size: int) -> bytes: ... # type: ignore[override]
class BufferedWriter(BufferedIOBase, BinaryIO): # type: ignore # argument disparities between base classes
class BufferedWriter(BufferedIOBase, BinaryIO):
def __enter__(self: Self) -> Self: ...
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
def write(self, __buffer: ReadableBuffer) -> int: ...
@@ -175,7 +175,7 @@ class TextIOBase(IOBase):
def read(self, __size: int | None = ...) -> str: ...
def tell(self) -> int: ...
class TextIOWrapper(TextIOBase, TextIO): # type: ignore # argument disparities between base classes
class TextIOWrapper(TextIOBase, TextIO):
def __init__(
self,
buffer: IO[bytes],