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