@@ -31,9 +31,17 @@ from _typeshed import (
3131import numpy as np
3232from pandas .core .arrays .boolean import BooleanArray
3333from pandas .core .base import (
34+ ArrayIndexTimedeltaNoSeq ,
3435 ElementOpsMixin ,
36+ IndexComplex ,
3537 IndexOpsMixin ,
38+ IndexReal ,
39+ ScalarArrayIndexComplex ,
40+ ScalarArrayIndexIntNoBool ,
41+ ScalarArrayIndexJustComplex ,
42+ ScalarArrayIndexJustFloat ,
3643 ScalarArrayIndexReal ,
44+ ScalarArrayIndexTimedelta ,
3745 Supports_ProtoAdd ,
3846 Supports_ProtoFloorDiv ,
3947 Supports_ProtoMul ,
@@ -939,17 +947,19 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
939947 self : Index [T_COMPLEX ], other : np_ndarray_complex | Index [complex ]
940948 ) -> Index [complex ]: ...
941949 @overload
942- def __truediv__ (
943- self : Index [Never ], other : complex | ArrayLike | SequenceNotStr [S1 ] | Index
950+ def __truediv__ (self , other : np_ndarray_dt ) -> Never : ...
951+ @overload
952+ def __truediv__ ( # type: ignore[overload-overlap]
953+ self : Index [Never ], other : ScalarArrayIndexComplex
944954 ) -> Index : ...
945955 @overload
946- def __truediv__ (self , other : Index [Never ]) -> Index : ...
956+ def __truediv__ (self : Index [Never ], other : ArrayIndexTimedeltaNoSeq ) -> Never : ...
947957 @overload
948- def __truediv__ (self : Index [bool ], other : np_ndarray_bool ) -> Never : ...
958+ def __truediv__ (self : Index [T_COMPLEX ], other : np_ndarray_td ) -> Never : ...
949959 @overload
950- def __truediv__ (self , other : np_ndarray_dt ) -> Never : ...
960+ def __truediv__ (self : Index [ bool ] , other : np_ndarray_bool ) -> Never : ...
951961 @overload
952- def __truediv__ (self : Index [ T_COMPLEX ] , other : np_ndarray_td ) -> Never : ...
962+ def __truediv__ (self : IndexComplex , other : Index [ Never ] ) -> Index : ...
953963 @overload
954964 def __truediv__ (
955965 self : Supports_ProtoTrueDiv [_T_contra , S2 ],
@@ -961,8 +971,7 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
961971 ) -> Index [float ]: ...
962972 @overload
963973 def __truediv__ (
964- self : Index [bool ] | Index [int ],
965- other : Just [int ] | Sequence [int ] | np_ndarray_anyint | Index [int ],
974+ self : Index [bool ] | Index [int ], other : ScalarArrayIndexIntNoBool
966975 ) -> Index [float ]: ...
967976 @overload
968977 def __truediv__ (
@@ -976,36 +985,32 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
976985 ) -> Index [complex ]: ...
977986 @overload
978987 def __truediv__ (
979- self : Index [bool ] | Index [int ],
980- other : Just [float ] | Sequence [Just [float ]] | np_ndarray_float | Index [float ],
988+ self : Index [bool ] | Index [int ], other : ScalarArrayIndexJustFloat
981989 ) -> Index [float ]: ...
982990 @overload
983991 def __truediv__ (
984- self : Index [T_COMPLEX ],
985- other : Just [float ] | Sequence [Just [float ]] | np_ndarray_float | Index [float ],
992+ self : Index [T_COMPLEX ], other : ScalarArrayIndexJustFloat
986993 ) -> Index [T_COMPLEX ]: ...
987994 @overload
988995 def __truediv__ (
989- self : Index [T_COMPLEX ],
990- other : (
991- Just [complex ]
992- | Sequence [Just [complex ]]
993- | np_ndarray_complex
994- | Index [complex ]
995- ),
996+ self : IndexComplex , other : ScalarArrayIndexJustComplex
996997 ) -> Index [complex ]: ...
997998 @overload
998- def __truediv__ (self , other : Path ) -> Index : ...
999+ def __truediv__ (self : Index [ _str ] , other : Path ) -> Index : ...
9991000 @overload
1000- def __rtruediv__ (
1001- self : Index [Never ], other : complex | ArrayLike | SequenceNotStr [S1 ] | Index
1002- ) -> Index : ...
1001+ def __rtruediv__ (self , other : np_ndarray_dt ) -> Never : ...
10031002 @overload
1004- def __rtruediv__ (self , other : Index [Never ]) -> Index : ... # type: ignore[overload-overlap]
1003+ def __rtruediv__ ( # type: ignore[overload-overlap]
1004+ self : Index [Never ], other : ScalarArrayIndexComplex | ScalarArrayIndexTimedelta
1005+ ) -> Index : ...
10051006 @overload
1006- def __rtruediv__ (self : Index [bool ], other : np_ndarray_bool ) -> Never : ...
1007+ def __rtruediv__ ( # type: ignore[overload-overlap]
1008+ self : IndexComplex , other : Index [Never ]
1009+ ) -> Index : ...
10071010 @overload
1008- def __rtruediv__ (self , other : np_ndarray_dt ) -> Never : ...
1011+ def __rtruediv__ ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
1012+ self : Index [int ] | Index [float ], other : Sequence [timedelta | np .timedelta64 ]
1013+ ) -> Index : ...
10091014 @overload
10101015 def __rtruediv__ (
10111016 self : Supports_ProtoRTrueDiv [_T_contra , S2 ],
@@ -1017,8 +1022,7 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
10171022 ) -> Index [float ]: ...
10181023 @overload
10191024 def __rtruediv__ (
1020- self : Index [bool ] | Index [int ],
1021- other : Just [int ] | Sequence [int ] | np_ndarray_anyint | Index [int ],
1025+ self : Index [bool ] | Index [int ], other : ScalarArrayIndexIntNoBool
10221026 ) -> Index [float ]: ...
10231027 @overload
10241028 def __rtruediv__ ( # type: ignore[misc]
@@ -1032,43 +1036,35 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
10321036 ) -> Index [complex ]: ...
10331037 @overload
10341038 def __rtruediv__ (
1035- self : Index [bool ] | Index [int ],
1036- other : Just [float ] | Sequence [Just [float ]] | np_ndarray_float | Index [float ],
1039+ self : Index [bool ] | Index [int ], other : ScalarArrayIndexJustFloat
10371040 ) -> Index [float ]: ...
10381041 @overload
10391042 def __rtruediv__ (
1040- self : Index [T_COMPLEX ],
1041- other : Just [float ] | Sequence [Just [float ]] | np_ndarray_float | Index [float ],
1043+ self : Index [T_COMPLEX ], other : ScalarArrayIndexJustFloat
10421044 ) -> Index [T_COMPLEX ]: ...
10431045 @overload
10441046 def __rtruediv__ (
1045- self : Index [T_COMPLEX ],
1046- other : (
1047- Just [complex ]
1048- | Sequence [Just [complex ]]
1049- | np_ndarray_complex
1050- | Index [complex ]
1051- ),
1047+ self : IndexComplex , other : ScalarArrayIndexJustComplex
10521048 ) -> Index [complex ]: ...
10531049 @overload
10541050 def __rtruediv__ (
1055- self : Index [int ] | Index [float ],
1056- other : timedelta | np .timedelta64 | np_ndarray_td | TimedeltaIndex ,
1051+ self : Index [int ] | Index [float ], other : ScalarArrayIndexTimedelta
10571052 ) -> TimedeltaIndex : ...
10581053 @overload
1059- def __rtruediv__ (self , other : Path ) -> Index : ...
1054+ def __rtruediv__ (self : Index [ _str ] , other : Path ) -> Index : ...
10601055 @overload
1061- def __floordiv__ (self : Index [ Never ] , other : ScalarArrayIndexReal ) -> Index : ...
1056+ def __floordiv__ (self , other : np_ndarray_dt ) -> Never : ...
10621057 @overload
1063- def __floordiv__ (
1064- self : Index [bool ] | Index [int ] | Index [float ], other : Index [Never ]
1065- ) -> Index : ...
1058+ def __floordiv__ (self : Index [Never ], other : np_ndarray_td ) -> Never : ...
10661059 @overload
10671060 def __floordiv__ (
1068- self : Index [int ] | Index [float ],
1069- other : np_ndarray_complex | np_ndarray_dt | np_ndarray_td ,
1061+ self : Index [int ] | Index [float ], other : np_ndarray_complex | np_ndarray_td
10701062 ) -> Never : ...
10711063 @overload
1064+ def __floordiv__ (self : Index [Never ], other : ScalarArrayIndexReal ) -> Index : ...
1065+ @overload
1066+ def __floordiv__ (self : IndexReal , other : Index [Never ]) -> Index : ...
1067+ @overload
10721068 def __floordiv__ (
10731069 self : Index [bool ] | Index [complex ], other : np_ndarray
10741070 ) -> Never : ...
@@ -1099,21 +1095,24 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
10991095 other : float | Sequence [float ] | np_ndarray_float | Index [float ],
11001096 ) -> Index [float ]: ...
11011097 @overload
1102- def __rfloordiv__ (self : Index [Never ], other : ScalarArrayIndexReal ) -> Index : ...
1103- @overload
11041098 def __rfloordiv__ ( # type: ignore[overload-overlap]
1105- self : Index [bool ] | Index [ int ] | Index [ float ] , other : Index [ Never ]
1099+ self : Index [Never ] , other : ScalarArrayIndexReal
11061100 ) -> Index : ...
11071101 @overload
1102+ def __rfloordiv__ (self , other : np_ndarray_complex | np_ndarray_dt ) -> Never : ...
1103+ @overload
11081104 def __rfloordiv__ (
1109- self : Index [int ] | Index [float ],
1110- other : np_ndarray_complex | np_ndarray_dt | np_ndarray_td ,
1105+ self : Index [int ] | Index [float ], other : np_ndarray_td
11111106 ) -> Never : ...
11121107 @overload
11131108 def __rfloordiv__ (
11141109 self : Index [bool ] | Index [complex ], other : np_ndarray
11151110 ) -> Never : ...
11161111 @overload
1112+ def __rfloordiv__ ( # type: ignore[overload-overlap]
1113+ self : IndexReal , other : Index [Never ]
1114+ ) -> Index : ...
1115+ @overload
11171116 def __rfloordiv__ (
11181117 self : Supports_ProtoRFloorDiv [_T_contra , S2 ],
11191118 other : _T_contra | Sequence [_T_contra ],
@@ -1142,8 +1141,12 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
11421141 @overload
11431142 def __rfloordiv__ (
11441143 self : Index [int ] | Index [float ],
1145- other : timedelta | np_ndarray_td | TimedeltaIndex ,
1144+ other : timedelta | np . timedelta64 | ArrayIndexTimedeltaNoSeq ,
11461145 ) -> TimedeltaIndex : ...
1146+ @overload
1147+ def __rfloordiv__ (
1148+ self : Index [int ] | Index [float ], other : Sequence [timedelta | np .timedelta64 ]
1149+ ) -> Index : ...
11471150 def infer_objects (self , copy : bool = True ) -> Self : ...
11481151
11491152@type_check_only
0 commit comments