mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Stdlib: add many missing __hash__ and __eq__ methods (#10464)
This commit is contained in:
@@ -874,6 +874,8 @@ class memoryview(Sequence[int]):
|
||||
def __contains__(self, __x: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __setitem__(self, __key: slice, __value: ReadableBuffer) -> None: ...
|
||||
@overload
|
||||
@@ -941,6 +943,7 @@ class slice:
|
||||
def __init__(self, __stop: Any) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __start: Any, __stop: Any, __step: Any = ...) -> None: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def indices(self, __len: SupportsIndex) -> tuple[int, int, int]: ...
|
||||
|
||||
@@ -957,6 +960,8 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
def __le__(self, __value: tuple[_T_co, ...]) -> bool: ...
|
||||
def __gt__(self, __value: tuple[_T_co, ...]) -> bool: ...
|
||||
def __ge__(self, __value: tuple[_T_co, ...]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __add__(self, __value: tuple[_T_co, ...]) -> tuple[_T_co, ...]: ...
|
||||
@overload
|
||||
@@ -1045,6 +1050,7 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
def __ge__(self, __value: list[_T]) -> bool: ...
|
||||
def __lt__(self, __value: list[_T]) -> bool: ...
|
||||
def __le__(self, __value: list[_T]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
@@ -1097,6 +1103,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __setitem__(self, __key: _KT, __value: _VT) -> None: ...
|
||||
def __delitem__(self, __key: _KT) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@@ -1151,6 +1158,7 @@ class set(MutableSet[_T], Generic[_T]):
|
||||
def __lt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
@@ -1179,6 +1187,8 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]):
|
||||
def __lt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
@@ -1204,6 +1214,8 @@ class range(Sequence[int]):
|
||||
def count(self, __value: int) -> int: ...
|
||||
def index(self, __value: int) -> int: ... # type: ignore[override]
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __contains__(self, __key: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user