diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 2e9ea8591b80..9feda83891ae 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -529,7 +529,7 @@ class tuple(Sequence[_T_co], Generic[_T_co]): def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... - def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __add__(self, x: Tuple[_S, ...]) -> Tuple[Union[_T_co, _S], ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... def count(self, x: Any) -> int: ... @@ -571,8 +571,8 @@ class list(MutableSequence[_T], Generic[_T]): def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... def __delitem__(self, i: Union[int, slice]) -> None: ... def __delslice__(self, start: int, stop: int) -> None: ... - def __add__(self, x: List[_T]) -> List[_T]: ... - def __iadd__(self, x: Iterable[_T]) -> List[_T]: ... + def __add__(self, x: List[_S]) -> List[Union[_T, _S]]: ... + def __iadd__(self, x: Iterable[_T]) -> List[_T]: ... # type: ignore def __mul__(self, n: int) -> List[_T]: ... def __rmul__(self, n: int) -> List[_T]: ... def __contains__(self, o: object) -> bool: ... diff --git a/stdlib/2/builtins.pyi b/stdlib/2/builtins.pyi index 2e9ea8591b80..9feda83891ae 100644 --- a/stdlib/2/builtins.pyi +++ b/stdlib/2/builtins.pyi @@ -529,7 +529,7 @@ class tuple(Sequence[_T_co], Generic[_T_co]): def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... - def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __add__(self, x: Tuple[_S, ...]) -> Tuple[Union[_T_co, _S], ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... def count(self, x: Any) -> int: ... @@ -571,8 +571,8 @@ class list(MutableSequence[_T], Generic[_T]): def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... def __delitem__(self, i: Union[int, slice]) -> None: ... def __delslice__(self, start: int, stop: int) -> None: ... - def __add__(self, x: List[_T]) -> List[_T]: ... - def __iadd__(self, x: Iterable[_T]) -> List[_T]: ... + def __add__(self, x: List[_S]) -> List[Union[_T, _S]]: ... + def __iadd__(self, x: Iterable[_T]) -> List[_T]: ... # type: ignore def __mul__(self, n: int) -> List[_T]: ... def __rmul__(self, n: int) -> List[_T]: ... def __contains__(self, o: object) -> bool: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 78c598592c77..efd1b5d287c7 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -569,7 +569,7 @@ class tuple(Sequence[_T_co], Generic[_T_co]): def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... - def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __add__(self, x: Tuple[_S, ...]) -> Tuple[Union[_T_co, _S], ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... def count(self, x: Any) -> int: ... @@ -616,8 +616,8 @@ class list(MutableSequence[_T], Generic[_T]): @overload def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... def __delitem__(self, i: Union[int, slice]) -> None: ... - def __add__(self, x: List[_T]) -> List[_T]: ... - def __iadd__(self, x: Iterable[_T]) -> List[_T]: ... + def __add__(self, x: List[_S]) -> List[Union[_T, _S]]: ... + def __iadd__(self, x: Iterable[_T]) -> List[_T]: ... # type: ignore def __mul__(self, n: int) -> List[_T]: ... def __rmul__(self, n: int) -> List[_T]: ... def __imul__(self, n: int) -> List[_T]: ...