slices of MutableSequences are also MutableSequences (#2428)

This commit is contained in:
Michael R. Crusoe
2018-09-25 23:06:59 +03:00
committed by Jelle Zijlstra
parent ea2122741f
commit 2e0af18dda
5 changed files with 22 additions and 6 deletions

View File

@@ -13,9 +13,9 @@ class UserString(Sequence[UserString]):
def __hash__(self) -> int: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self: _UST, i: int) -> _UST: ...
def __getitem__(self: _UST, i: int) -> _UST: ... # type: ignore
@overload
def __getitem__(self: _UST, s: slice) -> _UST: ...
def __getitem__(self: _UST, s: slice) -> _UST: ... # type: ignore
def __add__(self: _UST, other: Any) -> _UST: ...
def __radd__(self: _UST, other: Any) -> _UST: ...
def __mul__(self: _UST, other: int) -> _UST: ...
@@ -61,7 +61,11 @@ class UserString(Sequence[UserString]):
def upper(self: _UST) -> _UST: ...
def zfill(self: _UST, width: int) -> _UST: ...
class MutableString(UserString, MutableSequence[MutableString]):
class MutableString(UserString, MutableSequence[MutableString]): # type: ignore
@overload
def __getitem__(self: _MST, i: int) -> _MST: ...
@overload
def __getitem__(self: _MST, s: slice) -> _MST: ...
def __setitem__(self, index: Union[int, slice], sub: Any) -> None: ...
def __delitem__(self, index: Union[int, slice]) -> None: ...
def immutable(self) -> UserString: ...