mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-28 22:02:24 +08:00
Add __hash__ for a bunch of types that set it to None (#13286)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _collections_abc import dict_items, dict_keys, dict_values
|
||||
from _typeshed import SupportsItems, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT
|
||||
from typing import Any, Generic, NoReturn, SupportsIndex, TypeVar, final, overload
|
||||
from typing import Any, ClassVar, Generic, NoReturn, SupportsIndex, TypeVar, final, overload
|
||||
from typing_extensions import Self
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -119,6 +119,7 @@ class UserList(MutableSequence[_T]):
|
||||
def __init__(self, initlist: None = None) -> None: ...
|
||||
@overload
|
||||
def __init__(self, initlist: Iterable[_T]) -> None: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __lt__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
def __le__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
def __gt__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
@@ -254,6 +255,7 @@ class deque(MutableSequence[_T]):
|
||||
def rotate(self, n: int = 1, /) -> None: ...
|
||||
def __copy__(self) -> Self: ...
|
||||
def __len__(self) -> int: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
|
||||
def __getitem__(self, key: SupportsIndex, /) -> _T: ... # type: ignore[override]
|
||||
def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ... # type: ignore[override]
|
||||
|
||||
Reference in New Issue
Block a user