File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
pandas-stubs/core/indexes Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ from typing_extensions import (
43
43
from pandas ._libs .interval import _OrderableT
44
44
from pandas ._typing import (
45
45
S1 ,
46
- S2 ,
47
46
AnyAll ,
48
47
AxesData ,
49
48
DropKeep ,
@@ -405,9 +404,7 @@ class Index(IndexOpsMixin[S1]):
405
404
@overload
406
405
def append (self , other : Index [S1 ] | Sequence [Index [S1 ]]) -> Self : ...
407
406
@overload
408
- def append (self , other : Index [S2 ]) -> Index [S1 | S2 ]: ...
409
- @overload
410
- def append (self , other : Sequence [Index ]) -> Index : ...
407
+ def append (self , other : Index | Sequence [Index ]) -> Index : ...
411
408
def putmask (self , mask , value ): ...
412
409
def equals (self , other ) -> bool : ...
413
410
@final
Original file line number Diff line number Diff line change @@ -1031,19 +1031,14 @@ def test_getitem() -> None:
1031
1031
1032
1032
1033
1033
def test_append_mix () -> None :
1034
- """Test pd.Index.append that gives pd.Index[Any] """
1034
+ """Test pd.Index.append with mixed types """
1035
1035
first = pd .Index ([1 ])
1036
1036
second = pd .Index (["a" ])
1037
1037
third = pd .Index ([1 , "a" ])
1038
- check (assert_type (first .append (second ), " pd.Index[int | str]" ), pd .Index )
1038
+ check (assert_type (first .append (second ), pd .Index ), pd .Index )
1039
1039
check (assert_type (first .append ([second ]), pd .Index ), pd .Index )
1040
1040
1041
- check (
1042
- assert_type ( # type: ignore[assert-type]
1043
- first .append (third ), "pd.Index[int | str]"
1044
- ),
1045
- pd .Index ,
1046
- )
1041
+ check (assert_type (first .append (third ), pd .Index ), pd .Index )
1047
1042
check (assert_type (first .append ([third ]), pd .Index ), pd .Index )
1048
1043
check (assert_type (first .append ([second , third ]), pd .Index ), pd .Index )
1049
1044
You can’t perform that action at this time.
0 commit comments