Specialize plain slice type hints (#13007)

This commit is contained in:
Randolf Scholz
2026-01-23 10:35:39 +01:00
committed by GitHub
parent 2ff920f291
commit 5c49b1fe49
15 changed files with 69 additions and 69 deletions
+3 -3
View File
@@ -80,12 +80,12 @@ class array(MutableSequence[_T]):
@overload
def __getitem__(self, key: SupportsIndex, /) -> _T: ...
@overload
def __getitem__(self, key: slice, /) -> array[_T]: ...
def __getitem__(self, key: slice[SupportsIndex | None], /) -> array[_T]: ...
@overload # type: ignore[override]
def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ...
@overload
def __setitem__(self, key: slice, value: array[_T], /) -> None: ...
def __delitem__(self, key: SupportsIndex | slice, /) -> None: ...
def __setitem__(self, key: slice[SupportsIndex | None], value: array[_T], /) -> None: ...
def __delitem__(self, key: SupportsIndex | slice[SupportsIndex | None], /) -> None: ...
def __add__(self, value: array[_T], /) -> array[_T]: ...
def __eq__(self, value: object, /) -> bool: ...
def __ge__(self, value: array[_T], /) -> bool: ...