mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-25 05:57:22 +08:00
Improve Self type usage accross stdlib (#7183)
This commit is contained in:
1 parent
03dbe2206c
commit
6882e513c2
2 files changed
+8
-10
No files matched your search
@@ -112,8 +112,6 @@ class UserList(MutableSequence[_T]):
|
||||
def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ...
|
||||
def extend(self, other: Iterable[_T]) -> None: ...
|
||||
|
||||
_UserStringT = TypeVar("_UserStringT", bound=UserString)
|
||||
|
||||
class UserString(Sequence[str]):
|
||||
data: str
|
||||
def __init__(self, seq: object) -> None: ...
|
||||
@@ -129,8 +127,8 @@ class UserString(Sequence[str]):
|
||||
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: _UserStringT) -> Iterator[_UserStringT]: ... # type: ignore[override]
|
||||
def __reversed__(self: _UserStringT) -> Iterator[_UserStringT]: ... # type: ignore[override]
|
||||
def __iter__(self: Self) -> Iterator[Self]: ... # type: ignore[override]
|
||||
def __reversed__(self: Self) -> Iterator[Self]: ... # type: ignore[override]
|
||||
def __add__(self: Self, other: object) -> Self: ...
|
||||
def __mul__(self: Self, n: int) -> Self: ...
|
||||
def __mod__(self: Self, args: Any) -> Self: ...
|
||||
|
||||
Reference in new issue
Block a user