mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
__builtin__: Change signature of bytearray.__delitem__.
Signature of bytearray.__delitem__ is overloaded to support both int and slice as parameters. Use a union instead. This is needed to change bytearray's superclass from Sequence[int] to MutableSequence[int], because the current signature of __delitem__ is incompatible with that of MutableSequence.
This commit is contained in:
@@ -431,10 +431,7 @@ class bytearray(Sequence[int]):
|
||||
@overload
|
||||
def __setitem__(self, s: slice, x: Union[Sequence[int], str]) -> None: ...
|
||||
def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ...
|
||||
@overload
|
||||
def __delitem__(self, i: int) -> None: ...
|
||||
@overload
|
||||
def __delitem__(self, s: slice) -> None: ...
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
def __delslice__(self, start: int, stop: int) -> None: ...
|
||||
def __add__(self, s: str) -> bytearray: ...
|
||||
def __mul__(self, n: int) -> bytearray: ...
|
||||
|
||||
Reference in New Issue
Block a user