From c4da3757d7a513f6caf8924c59b6c16aed55c91e Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 26 May 2021 13:17:30 -0700 Subject: [PATCH] Improve tuple.__add__ type (#5522) Noticed this while browsing the stub. This feels safe but we'll see what mypy-primer has to say. --- stdlib/builtins.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 865c6e9a1..752755d2b 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -724,7 +724,7 @@ class tuple(Sequence[_T_co], Generic[_T_co]): @overload def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... @overload - def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... + def __add__(self, x: Tuple[_T, ...]) -> Tuple[Union[_T_co, _T], ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... def count(self, __value: Any) -> int: ...