From a62a7af1c52dc36906f23eed46dc27ec6afd92b7 Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Sat, 9 Jul 2016 02:28:45 +0530 Subject: [PATCH] __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. --- stdlib/2.7/__builtin__.pyi | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stdlib/2.7/__builtin__.pyi b/stdlib/2.7/__builtin__.pyi index 120007b73..464c1e0cf 100644 --- a/stdlib/2.7/__builtin__.pyi +++ b/stdlib/2.7/__builtin__.pyi @@ -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: ...