__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:
Eklavya Sharma
2016-07-09 02:28:45 +05:30
parent 0c75a22ffb
commit a62a7af1c5

View File

@@ -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: ...