mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Modified __add__ method in tuple class (#3252)
Modified __add__ method in tuple class to allow it to accept tuples with different generic parameter types. This allows, for example: a = (1, ) b = a + (2.4, )
This commit is contained in:
committed by
Jelle Zijlstra
parent
23232c056c
commit
468d13a205
@@ -867,7 +867,10 @@ 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: ...
|
||||
@overload
|
||||
def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ...
|
||||
@overload
|
||||
def __add__(self, x: tuple) -> tuple: ...
|
||||
def __mul__(self, n: int) -> Tuple[_T_co, ...]: ...
|
||||
def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ...
|
||||
def count(self, x: Any) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user