Skip to content

Commit d8db897

Browse files
committed
better name for the typevar
1 parent b5ad828 commit d8db897

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stdlib/builtins.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ _T2 = TypeVar("_T2")
9090
_T3 = TypeVar("_T3")
9191
_T4 = TypeVar("_T4")
9292
_T5 = TypeVar("_T5")
93+
_Expected = TypeVar("_Expected")
9394
_SupportsNextT_co = TypeVar("_SupportsNextT_co", bound=SupportsNext[Any], covariant=True)
9495
_SupportsAnextT_co = TypeVar("_SupportsAnextT_co", bound=SupportsAnext[Any], covariant=True)
9596
_AwaitableT = TypeVar("_AwaitableT", bound=Awaitable[Any])
@@ -1138,9 +1139,9 @@ class list(MutableSequence[_T]):
11381139
# Overloading looks unnecessary, but is needed to work around complex mypy problems
11391140
@overload
11401141
# # `__add__` returns a new object, so we capture the expected result type with a type variable
1141-
def __add__(self, value: list[_T], /) -> list[_T1 | _T]: ...
1142+
def __add__(self, value: list[_T], /) -> list[_Expected | _T]: ...
11421143
@overload
1143-
def __add__(self, value: list[_S], /) -> list[_T1 | _T | _S]: ...
1144+
def __add__(self, value: list[_S], /) -> list[_Expected | _T | _S]: ...
11441145
def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[misc]
11451146
def __mul__(self, value: SupportsIndex, /) -> list[_T]: ...
11461147
def __rmul__(self, value: SupportsIndex, /) -> list[_T]: ...

0 commit comments

Comments
 (0)