diff --git a/stdlib/@python2/lib2to3/pgen2/pgen.pyi b/stdlib/@python2/lib2to3/pgen2/pgen.pyi index 5b2dc70ed..daddcf0cf 100644 --- a/stdlib/@python2/lib2to3/pgen2/pgen.pyi +++ b/stdlib/@python2/lib2to3/pgen2/pgen.pyi @@ -41,6 +41,6 @@ class DFAState: def __init__(self, nfaset: dict[NFAState, Any], final: NFAState) -> None: ... def addarc(self, next: DFAState, label: Text) -> None: ... def unifystate(self, old: DFAState, new: DFAState) -> None: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override] def generate_grammar(filename: StrPath = ...) -> PgenGrammar: ... diff --git a/stdlib/@python2/lib2to3/pytree.pyi b/stdlib/@python2/lib2to3/pytree.pyi index d96df2a9d..130f03dab 100644 --- a/stdlib/@python2/lib2to3/pytree.pyi +++ b/stdlib/@python2/lib2to3/pytree.pyi @@ -20,7 +20,7 @@ class Base: children: list[_NL] was_changed: bool was_checked: bool - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def _eq(self: _P, other: _P) -> bool: ... def clone(self: Self) -> Self: ... def post_order(self) -> Iterator[_NL]: ... diff --git a/stdlib/@python2/numbers.pyi b/stdlib/@python2/numbers.pyi index fb88e076d..73384a308 100644 --- a/stdlib/@python2/numbers.pyi +++ b/stdlib/@python2/numbers.pyi @@ -46,8 +46,8 @@ class Complex(Number): def __rpow__(self, base: Any) -> Any: ... def __abs__(self) -> Real: ... def conjugate(self) -> Any: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... class Real(Complex, SupportsFloat): @abstractmethod diff --git a/stdlib/@python2/sets.pyi b/stdlib/@python2/sets.pyi index 916cb3def..7cafbaf8a 100644 --- a/stdlib/@python2/sets.pyi +++ b/stdlib/@python2/sets.pyi @@ -9,8 +9,8 @@ class BaseSet(Iterable[_T]): def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... def __cmp__(self, other: Any) -> int: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... def copy(self: Self) -> Self: ... def __copy__(self: Self) -> Self: ... def __deepcopy__(self: Self, memo: MutableMapping[int, BaseSet[_T]]) -> Self: ... diff --git a/stdlib/@python2/xml/dom/minidom.pyi b/stdlib/@python2/xml/dom/minidom.pyi index 10a0ddd03..b09d1a503 100644 --- a/stdlib/@python2/xml/dom/minidom.pyi +++ b/stdlib/@python2/xml/dom/minidom.pyi @@ -71,7 +71,7 @@ class NamedNodeMap: def values(self): ... def get(self, name, value: Any | None = ...): ... def __len__(self) -> int: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def __ge__(self, other: Any) -> bool: ... def __gt__(self, other: Any) -> bool: ... def __le__(self, other: Any) -> bool: ... diff --git a/stdlib/email/charset.pyi b/stdlib/email/charset.pyi index 298b76354..d7396e4f2 100644 --- a/stdlib/email/charset.pyi +++ b/stdlib/email/charset.pyi @@ -1,4 +1,4 @@ -from typing import Any, Iterator +from typing import Iterator QP: int # undocumented BASE64: int # undocumented @@ -17,8 +17,8 @@ class Charset: def header_encode(self, string: str) -> str: ... def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ... def body_encode(self, string: str) -> str: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... def add_charset( charset: str, header_enc: int | None = ..., body_enc: int | None = ..., output_charset: str | None = ... diff --git a/stdlib/email/header.pyi b/stdlib/email/header.pyi index 4490c16a4..0fd4bd3d5 100644 --- a/stdlib/email/header.pyi +++ b/stdlib/email/header.pyi @@ -1,5 +1,4 @@ from email.charset import Charset -from typing import Any class Header: def __init__( @@ -13,8 +12,8 @@ class Header: ) -> None: ... def append(self, s: bytes | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ... def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... def decode_header(header: Header | str) -> list[tuple[bytes, str | None]]: ... def make_header( diff --git a/stdlib/ipaddress.pyi b/stdlib/ipaddress.pyi index 0b29f2633..b703e9570 100644 --- a/stdlib/ipaddress.pyi +++ b/stdlib/ipaddress.pyi @@ -14,12 +14,12 @@ def ip_network(address: object, strict: bool = ...) -> IPv4Network | IPv6Network def ip_interface(address: object) -> IPv4Interface | IPv6Interface: ... class _IPAddressBase: - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def __ge__(self: Self, other: Self) -> bool: ... def __gt__(self: Self, other: Self) -> bool: ... def __le__(self: Self, other: Self) -> bool: ... def __lt__(self: Self, other: Self) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __ne__(self, other: object) -> bool: ... @property def compressed(self) -> str: ... @property diff --git a/stdlib/lib2to3/pgen2/pgen.pyi b/stdlib/lib2to3/pgen2/pgen.pyi index 11680157d..2628e1223 100644 --- a/stdlib/lib2to3/pgen2/pgen.pyi +++ b/stdlib/lib2to3/pgen2/pgen.pyi @@ -41,6 +41,6 @@ class DFAState: def __init__(self, nfaset: dict[NFAState, Any], final: NFAState) -> None: ... def addarc(self, next: DFAState, label: str) -> None: ... def unifystate(self, old: DFAState, new: DFAState) -> None: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override] def generate_grammar(filename: StrPath = ...) -> PgenGrammar: ... diff --git a/stdlib/lib2to3/pytree.pyi b/stdlib/lib2to3/pytree.pyi index aefd30146..23a0069db 100644 --- a/stdlib/lib2to3/pytree.pyi +++ b/stdlib/lib2to3/pytree.pyi @@ -19,7 +19,7 @@ class Base: children: list[_NL] was_changed: bool was_checked: bool - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def _eq(self: Self, other: Self) -> bool: ... def clone(self: Self) -> Self: ... def post_order(self) -> Iterator[_NL]: ... diff --git a/stdlib/numbers.pyi b/stdlib/numbers.pyi index eaf53d253..d0024adbb 100644 --- a/stdlib/numbers.pyi +++ b/stdlib/numbers.pyi @@ -42,7 +42,7 @@ class Complex(Number): def __rpow__(self, base: Any) -> Any: ... def __abs__(self) -> Real: ... def conjugate(self) -> Any: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... class Real(Complex, SupportsFloat): @abstractmethod diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 210b49f44..732789aff 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -309,8 +309,8 @@ if sys.version_info >= (3, 7): __qualname__: str __objclass__: type def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... @final class MethodDescriptorType: __name__: str diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 0513a2f53..dcd9d920b 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -745,7 +745,7 @@ if sys.version_info >= (3, 7): else: def __init__(self, arg: str, is_argument: bool = ...) -> None: ... def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... if sys.version_info >= (3, 11): def __or__(self, other: Any) -> _SpecialForm: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index eb6942d5d..df3272138 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -1,5 +1,6 @@ import sys from typing import Any, Awaitable, Callable, Generic, Iterable, Mapping, Sequence, TypeVar, overload +from typing_extensions import Literal _T = TypeVar("_T") _TT = TypeVar("_TT", bound=type[Any]) @@ -83,8 +84,8 @@ class _Call(tuple[Any, ...]): def __init__( self, value: Any = ..., name: Any | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ... ) -> None: ... - def __eq__(self, other: Any) -> bool: ... - __ne__: Any + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... def __getattr__(self, attr: Any) -> Any: ... if sys.version_info >= (3, 8): @@ -418,8 +419,8 @@ class MagicProxy: def __get__(self, obj, _type: Any | None = ...): ... class _ANY: - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> Literal[True]: ... + def __ne__(self, other: object) -> Literal[False]: ... ANY: Any diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index e9a26e30d..b6a96f1e3 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -86,7 +86,7 @@ class NamedNodeMap: def values(self): ... def get(self, name, value: Any | None = ...): ... def __len__(self) -> int: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def __ge__(self, other: Any) -> bool: ... def __gt__(self, other: Any) -> bool: ... def __le__(self, other: Any) -> bool: ... diff --git a/stubs/boto/boto/utils.pyi b/stubs/boto/boto/utils.pyi index 16ed18bd6..1a2aabcf8 100644 --- a/stubs/boto/boto/utils.pyi +++ b/stubs/boto/boto/utils.pyi @@ -122,7 +122,7 @@ class Password: str: _str | None def __init__(self, str: _str | None = ..., hashfunc: Callable[[bytes], _HashType] | None = ...) -> None: ... def set(self, value: bytes | _str) -> None: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: _str | bytes | None) -> bool: ... # type: ignore[override] def __len__(self) -> int: ... def notify( diff --git a/stubs/invoke/invoke/tasks.pyi b/stubs/invoke/invoke/tasks.pyi index bcb46d7ff..7e4d5e5b4 100644 --- a/stubs/invoke/invoke/tasks.pyi +++ b/stubs/invoke/invoke/tasks.pyi @@ -62,7 +62,7 @@ class Call: ) -> None: ... def __getattr__(self, name: str) -> Any: ... def __deepcopy__(self, memo: Any) -> Task: ... - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: Call) -> bool: ... # type: ignore[override] def make_context(self, config: Config) -> Context: ... def clone_data(self): ... # TODO use overload diff --git a/stubs/ipaddress/@python2/ipaddress.pyi b/stubs/ipaddress/@python2/ipaddress.pyi index c6390dffc..f5adef207 100644 --- a/stubs/ipaddress/@python2/ipaddress.pyi +++ b/stubs/ipaddress/@python2/ipaddress.pyi @@ -14,12 +14,12 @@ def ip_network(address: object, strict: bool = ...) -> Any: ... # morally Union def ip_interface(address: object) -> Any: ... # morally Union[IPv4Interface, IPv6Interface] class _IPAddressBase: - def __eq__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> bool: ... def __ge__(self: _T, other: _T) -> bool: ... def __gt__(self: _T, other: _T) -> bool: ... def __le__(self: _T, other: _T) -> bool: ... def __lt__(self: _T, other: _T) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __ne__(self, other: object) -> bool: ... @property def compressed(self) -> Text: ... @property diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 43e158413..e18382b16 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -1,5 +1,6 @@ from collections.abc import Callable, Mapping, Sequence from typing import Any, Generic, TypeVar, overload +from typing_extensions import Literal _F = TypeVar("_F", bound=Callable[..., Any]) _T = TypeVar("_T") @@ -40,8 +41,8 @@ class _Call(tuple[Any, ...]): def __init__( self, value: Any = ..., name: Any | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ... ) -> None: ... - def __eq__(self, other: Any) -> bool: ... - __ne__: Any + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... def __getattr__(self, attr: str) -> Any: ... @property @@ -278,8 +279,8 @@ class MagicProxy(Base): def __get__(self, obj: Any, _type: Any | None = ...) -> Any: ... class _ANY: - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: object) -> Literal[True]: ... + def __ne__(self, other: object) -> Literal[False]: ... ANY: Any diff --git a/stubs/polib/polib.pyi b/stubs/polib/polib.pyi index cd5dbaf66..a9f9f5beb 100644 --- a/stubs/polib/polib.pyi +++ b/stubs/polib/polib.pyi @@ -95,8 +95,8 @@ class POEntry(_BaseEntry): def __lt__(self, other: POEntry) -> bool: ... def __ge__(self, other: POEntry) -> bool: ... def __le__(self, other: POEntry) -> bool: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... + def __eq__(self, other: POEntry) -> bool: ... # type: ignore[override] + def __ne__(self, other: POEntry) -> bool: ... # type: ignore[override] def translated(self) -> bool: ... def merge(self, other: POEntry) -> None: ... @property diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index a7dba8deb..0a1603fb6 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -78,7 +78,7 @@ class Requirement: @staticmethod def parse(s: str | Iterable[str]) -> Requirement: ... def __contains__(self, item: Distribution | str | tuple[str, ...]) -> bool: ... - def __eq__(self, other_requirement: Any) -> bool: ... + def __eq__(self, other_requirement: object) -> bool: ... def load_entry_point(dist: _EPDistType, group: str, name: str) -> Any: ... def get_entry_info(dist: _EPDistType, group: str, name: str) -> EntryPoint | None: ...