Check for unused pyright: ignore and differentiate from mypy ignores (#9397)

This commit is contained in:
Avasam
2022-12-28 05:44:29 -05:00
committed by GitHub
parent 07f587dc70
commit 23ac9bff19
17 changed files with 44 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from ..sql.traversals import HasCacheKey
@@ -100,7 +101,7 @@ class AbstractEntityRegistry(PathRegistry):
class SlotsEntityRegistry(AbstractEntityRegistry):
inherit_cache: bool
class CachingEntityRegistry(AbstractEntityRegistry, dict): # type: ignore[misc]
class CachingEntityRegistry(AbstractEntityRegistry, dict[Incomplete, Incomplete]): # type: ignore[misc]
inherit_cache: bool
def __getitem__(self, entity): ...
def __missing__(self, key): ...

View File

@@ -85,13 +85,13 @@ class OrderedSet(set[_T], Generic[_T]):
def update(self: Self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override]
__ior__ = update # type: ignore[assignment]
def union(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... # type: ignore[override]
__or__ = union # type: ignore[assignment]
__or__ = union # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues]
def intersection(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override]
__and__ = intersection # type: ignore[assignment]
__and__ = intersection # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues]
def symmetric_difference(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ...
__xor__ = symmetric_difference # type: ignore[assignment]
__xor__ = symmetric_difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues]
def difference(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override]
__sub__ = difference # type: ignore[assignment]
__sub__ = difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues]
def intersection_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override]
__iand__ = intersection_update # type: ignore[assignment]
def symmetric_difference_update(self: Self, other: Iterable[_T]) -> Self: ... # type: ignore[override]