diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 5bc282bf3..36849f40a 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -112,7 +112,7 @@ class UserList(MutableSequence[_T]): def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... def extend(self, other: Iterable[_T]) -> None: ... -class UserString(Sequence[str]): +class UserString(Sequence[UserString]): data: str def __init__(self, seq: object) -> None: ... def __int__(self) -> int: ... @@ -125,10 +125,9 @@ class UserString(Sequence[str]): def __ge__(self, string: str | UserString) -> bool: ... def __contains__(self, char: object) -> bool: ... def __len__(self) -> int: ... - # It should return a str to implement Sequence correctly, but it doesn't. - def __getitem__(self: Self, i: SupportsIndex | slice) -> Self: ... # type: ignore[override] - def __iter__(self: Self) -> Iterator[Self]: ... # type: ignore[override] - def __reversed__(self: Self) -> Iterator[Self]: ... # type: ignore[override] + def __getitem__(self: Self, i: SupportsIndex | slice) -> Self: ... + def __iter__(self: Self) -> Iterator[Self]: ... + def __reversed__(self: Self) -> Iterator[Self]: ... def __add__(self: Self, other: object) -> Self: ... def __mul__(self: Self, n: int) -> Self: ... def __mod__(self: Self, args: Any) -> Self: ...