@@ -15,7 +15,6 @@ from typing import (
1515 ClassVar ,
1616 Generic ,
1717 Literal ,
18- TypeAlias ,
1918 final ,
2019 overload ,
2120 type_check_only ,
@@ -50,6 +49,7 @@ from pandas._typing import (
5049 ArrayLike ,
5150 AxesData ,
5251 DropKeep ,
52+ Dtype ,
5353 DtypeArg ,
5454 DTypeLike ,
5555 DtypeObj ,
@@ -89,7 +89,6 @@ class Index(IndexOpsMixin[S1]):
8989 copy : bool = ...,
9090 name : Hashable = ...,
9191 tupleize_cols : bool = ...,
92- ** kwargs ,
9392 ) -> Index [int ]: ...
9493 @overload
9594 def __new__ (
@@ -100,7 +99,6 @@ class Index(IndexOpsMixin[S1]):
10099 copy : bool = ...,
101100 name : Hashable = ...,
102101 tupleize_cols : bool = ...,
103- ** kwargs ,
104102 ) -> Index [int ]: ...
105103 @overload
106104 def __new__ (
@@ -111,7 +109,6 @@ class Index(IndexOpsMixin[S1]):
111109 copy : bool = ...,
112110 name : Hashable = ...,
113111 tupleize_cols : bool = ...,
114- ** kwargs ,
115112 ) -> Index [float ]: ...
116113 @overload
117114 def __new__ (
@@ -122,7 +119,6 @@ class Index(IndexOpsMixin[S1]):
122119 copy : bool = ...,
123120 name : Hashable = ...,
124121 tupleize_cols : bool = ...,
125- ** kwargs ,
126122 ) -> Index [float ]: ...
127123 @overload
128124 def __new__ (
@@ -137,7 +133,6 @@ class Index(IndexOpsMixin[S1]):
137133 copy : bool = ...,
138134 name : Hashable = ...,
139135 tupleize_cols : bool = ...,
140- ** kwargs ,
141136 ) -> Index [complex ]: ...
142137 @overload
143138 def __new__ (
@@ -148,7 +143,6 @@ class Index(IndexOpsMixin[S1]):
148143 copy : bool = ...,
149144 name : Hashable = ...,
150145 tupleize_cols : bool = ...,
151- ** kwargs ,
152146 ) -> Index [complex ]: ...
153147 # special overloads with dedicated Index-subclasses
154148 @overload
@@ -160,7 +154,6 @@ class Index(IndexOpsMixin[S1]):
160154 copy : bool = ...,
161155 name : Hashable = ...,
162156 tupleize_cols : bool = ...,
163- ** kwargs ,
164157 ) -> DatetimeIndex : ...
165158 @overload
166159 def __new__ (
@@ -171,7 +164,6 @@ class Index(IndexOpsMixin[S1]):
171164 copy : bool = ...,
172165 name : Hashable = ...,
173166 tupleize_cols : bool = ...,
174- ** kwargs ,
175167 ) -> DatetimeIndex : ...
176168 @overload
177169 def __new__ (
@@ -182,7 +174,6 @@ class Index(IndexOpsMixin[S1]):
182174 copy : bool = ...,
183175 name : Hashable = ...,
184176 tupleize_cols : bool = ...,
185- ** kwargs ,
186177 ) -> PeriodIndex : ...
187178 @overload
188179 def __new__ (
@@ -193,7 +184,6 @@ class Index(IndexOpsMixin[S1]):
193184 copy : bool = ...,
194185 name : Hashable = ...,
195186 tupleize_cols : bool = ...,
196- ** kwargs ,
197187 ) -> PeriodIndex : ...
198188 @overload
199189 def __new__ (
@@ -204,7 +194,6 @@ class Index(IndexOpsMixin[S1]):
204194 copy : bool = ...,
205195 name : Hashable = ...,
206196 tupleize_cols : bool = ...,
207- ** kwargs ,
208197 ) -> TimedeltaIndex : ...
209198 @overload
210199 def __new__ (
@@ -215,7 +204,6 @@ class Index(IndexOpsMixin[S1]):
215204 copy : bool = ...,
216205 name : Hashable = ...,
217206 tupleize_cols : bool = ...,
218- ** kwargs ,
219207 ) -> TimedeltaIndex : ...
220208 @overload
221209 def __new__ (
@@ -226,7 +214,6 @@ class Index(IndexOpsMixin[S1]):
226214 copy : bool = ...,
227215 name : Hashable = ...,
228216 tupleize_cols : bool = ...,
229- ** kwargs ,
230217 ) -> IntervalIndex [Interval [_OrderableT ]]: ...
231218 @overload
232219 def __new__ (
@@ -237,7 +224,6 @@ class Index(IndexOpsMixin[S1]):
237224 copy : bool = ...,
238225 name : Hashable = ...,
239226 tupleize_cols : bool = ...,
240- ** kwargs ,
241227 ) -> IntervalIndex [Interval [Any ]]: ...
242228 # generic overloads
243229 @overload
@@ -249,7 +235,6 @@ class Index(IndexOpsMixin[S1]):
249235 copy : bool = ...,
250236 name : Hashable = ...,
251237 tupleize_cols : bool = ...,
252- ** kwargs ,
253238 ) -> Self : ...
254239 @overload
255240 def __new__ (
@@ -260,19 +245,17 @@ class Index(IndexOpsMixin[S1]):
260245 copy : bool = ...,
261246 name : Hashable = ...,
262247 tupleize_cols : bool = ...,
263- ** kwargs ,
264248 ) -> Self : ...
265249 # fallback overload
266250 @overload
267251 def __new__ (
268252 cls ,
269253 data : AxesData ,
270254 * ,
271- dtype = ...,
255+ dtype : Dtype = ...,
272256 copy : bool = ...,
273257 name : Hashable = ...,
274258 tupleize_cols : bool = ...,
275- ** kwargs ,
276259 ) -> Self : ...
277260 @property
278261 def str (
@@ -476,6 +459,8 @@ class Index(IndexOpsMixin[S1]):
476459 def __lt__ (self , other : Self | S1 ) -> np_1darray [np .bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
477460 def __gt__ (self , other : Self | S1 ) -> np_1darray [np .bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
478461 # overwrite inherited methods from OpsMixin
462+ def __sub__ (self , other : Any ) -> Self : ...
463+ def __rsub__ (self , other : Any ) -> Self : ...
479464 @overload
480465 def __mul__ (
481466 self : Index [int ] | Index [float ], other : timedelta
@@ -524,8 +509,6 @@ class Index(IndexOpsMixin[S1]):
524509 ) -> Self : ...
525510 def infer_objects (self , copy : bool = True ) -> Self : ...
526511
527- UnknownIndex : TypeAlias = Index [Any ]
528-
529512@type_check_only
530513class _IndexSubclassBase (Index [S1 ], Generic [S1 , GenericT_co ]):
531514 @overload
0 commit comments