slice is hashable starting with Python 3.12 (#12832)

This commit is contained in:
bersbersbers
2024-10-17 09:17:38 +02:00
committed by GitHub
parent 2d0f6d8277
commit b78b3f10ba

View File

@@ -948,7 +948,10 @@ class slice:
@overload
def __new__(cls, start: Any, stop: Any, step: Any = ..., /) -> Self: ...
def __eq__(self, value: object, /) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]
if sys.version_info >= (3, 12):
def __hash__(self) -> int: ...
else:
__hash__: ClassVar[None] # type: ignore[assignment]
def indices(self, len: SupportsIndex, /) -> tuple[int, int, int]: ...
class tuple(Sequence[_T_co]):