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

@@ -337,7 +337,7 @@ class unicode(basestring, Sequence[unicode]):
def __ge__(self, x: unicode) -> bool: ...
def __len__(self) -> int: ...
# The argument type is incompatible with Sequence
def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore
def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore[override]
def __iter__(self) -> Iterator[unicode]: ...
def __int__(self) -> int: ...
def __float__(self) -> float: ...
@@ -415,7 +415,7 @@ class str(Sequence[str], basestring):
def zfill(self, __width: int) -> str: ...
def __add__(self, s: AnyStr) -> AnyStr: ...
# Incompatible with Sequence.__contains__
def __contains__(self, o: str | Text) -> bool: ... # type: ignore
def __contains__(self, o: str | Text) -> bool: ... # type: ignore[override]
def __eq__(self, x: object) -> bool: ...
def __ge__(self, x: Text) -> bool: ...
def __getitem__(self, i: int | slice) -> str: ...
@@ -491,7 +491,7 @@ class bytearray(MutableSequence[int], ByteString):
def __iter__(self) -> Iterator[int]: ...
def __int__(self) -> int: ...
def __float__(self) -> float: ...
__hash__: ClassVar[None] # type: ignore
__hash__: ClassVar[None] # type: ignore[assignment]
@overload
def __getitem__(self, i: int) -> int: ...
@overload
@@ -507,7 +507,7 @@ class bytearray(MutableSequence[int], ByteString):
def __add__(self, s: bytes) -> bytearray: ...
def __mul__(self, n: int) -> bytearray: ...
# Incompatible with Sequence.__contains__
def __contains__(self, o: int | bytes) -> bool: ... # type: ignore
def __contains__(self, o: int | bytes) -> bool: ... # type: ignore[override]
def __eq__(self, x: object) -> bool: ...
def __ne__(self, x: object) -> bool: ...
def __lt__(self, x: bytes) -> bool: ...
@@ -575,7 +575,7 @@ class slice(object):
def __init__(self, stop: Any) -> None: ...
@overload
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
__hash__: ClassVar[None] # type: ignore
__hash__: ClassVar[None] # type: ignore[assignment]
def indices(self, len: int) -> tuple[int, int, int]: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
@@ -622,7 +622,7 @@ class list(MutableSequence[_T], Generic[_T]):
def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
__hash__: ClassVar[None] # type: ignore
__hash__: ClassVar[None] # type: ignore[assignment]
@overload
def __getitem__(self, i: int) -> _T: ...
@overload
@@ -684,7 +684,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __setitem__(self, k: _KT, v: _VT) -> None: ...
def __delitem__(self, v: _KT) -> None: ...
def __iter__(self) -> Iterator[_KT]: ...
__hash__: ClassVar[None] # type: ignore
__hash__: ClassVar[None] # type: ignore[assignment]
class set(MutableSet[_T], Generic[_T]):
def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
@@ -726,7 +726,7 @@ class set(MutableSet[_T], Generic[_T]):
def __lt__(self, s: AbstractSet[object]) -> bool: ...
def __ge__(self, s: AbstractSet[object]) -> bool: ...
def __gt__(self, s: AbstractSet[object]) -> bool: ...
__hash__: ClassVar[None] # type: ignore
__hash__: ClassVar[None] # type: ignore[assignment]
class frozenset(AbstractSet[_T_co], Generic[_T_co]):
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
@@ -785,10 +785,10 @@ class property(object):
long = int
class _NotImplementedType(Any): # type: ignore
class _NotImplementedType(Any): # type: ignore[misc]
# A little weird, but typing the __call__ as NotImplemented makes the error message
# for NotImplemented() much better
__call__: NotImplemented # type: ignore
__call__: NotImplemented # type: ignore[valid-type]
NotImplemented: _NotImplementedType