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
+4 -4
View File
@@ -129,12 +129,12 @@ class UserList(MutableSequence[_T]):
@overload
def __getitem__(self, i: SupportsIndex) -> _T: ...
@overload
def __getitem__(self, i: slice) -> Self: ...
def __getitem__(self, i: slice[SupportsIndex | None]) -> Self: ...
@overload
def __setitem__(self, i: SupportsIndex, item: _T) -> None: ...
@overload
def __setitem__(self, i: slice, item: Iterable[_T]) -> None: ...
def __delitem__(self, i: SupportsIndex | slice) -> None: ...
def __setitem__(self, i: slice[SupportsIndex | None], item: Iterable[_T]) -> None: ...
def __delitem__(self, i: SupportsIndex | slice[SupportsIndex | None]) -> None: ...
def __add__(self, other: Iterable[_T]) -> Self: ...
def __radd__(self, other: Iterable[_T]) -> Self: ...
def __iadd__(self, other: Iterable[_T]) -> Self: ...
@@ -174,7 +174,7 @@ class UserString(Sequence[UserString]):
def __hash__(self) -> int: ...
def __contains__(self, char: object) -> bool: ...
def __len__(self) -> int: ...
def __getitem__(self, index: SupportsIndex | slice) -> Self: ...
def __getitem__(self, index: SupportsIndex | slice[SupportsIndex | None]) -> Self: ...
def __iter__(self) -> Iterator[Self]: ...
def __reversed__(self) -> Iterator[Self]: ...
def __add__(self, other: object) -> Self: ...