@@ -15,7 +15,6 @@ from typing import (
15
15
ClassVar ,
16
16
Generic ,
17
17
Literal ,
18
- TypeAlias ,
19
18
final ,
20
19
overload ,
21
20
type_check_only ,
@@ -50,6 +49,7 @@ from pandas._typing import (
50
49
ArrayLike ,
51
50
AxesData ,
52
51
DropKeep ,
52
+ Dtype ,
53
53
DtypeArg ,
54
54
DTypeLike ,
55
55
DtypeObj ,
@@ -89,7 +89,6 @@ class Index(IndexOpsMixin[S1]):
89
89
copy : bool = ...,
90
90
name : Hashable = ...,
91
91
tupleize_cols : bool = ...,
92
- ** kwargs ,
93
92
) -> Index [int ]: ...
94
93
@overload
95
94
def __new__ (
@@ -100,7 +99,6 @@ class Index(IndexOpsMixin[S1]):
100
99
copy : bool = ...,
101
100
name : Hashable = ...,
102
101
tupleize_cols : bool = ...,
103
- ** kwargs ,
104
102
) -> Index [int ]: ...
105
103
@overload
106
104
def __new__ (
@@ -111,7 +109,6 @@ class Index(IndexOpsMixin[S1]):
111
109
copy : bool = ...,
112
110
name : Hashable = ...,
113
111
tupleize_cols : bool = ...,
114
- ** kwargs ,
115
112
) -> Index [float ]: ...
116
113
@overload
117
114
def __new__ (
@@ -122,7 +119,6 @@ class Index(IndexOpsMixin[S1]):
122
119
copy : bool = ...,
123
120
name : Hashable = ...,
124
121
tupleize_cols : bool = ...,
125
- ** kwargs ,
126
122
) -> Index [float ]: ...
127
123
@overload
128
124
def __new__ (
@@ -137,7 +133,6 @@ class Index(IndexOpsMixin[S1]):
137
133
copy : bool = ...,
138
134
name : Hashable = ...,
139
135
tupleize_cols : bool = ...,
140
- ** kwargs ,
141
136
) -> Index [complex ]: ...
142
137
@overload
143
138
def __new__ (
@@ -148,7 +143,6 @@ class Index(IndexOpsMixin[S1]):
148
143
copy : bool = ...,
149
144
name : Hashable = ...,
150
145
tupleize_cols : bool = ...,
151
- ** kwargs ,
152
146
) -> Index [complex ]: ...
153
147
# special overloads with dedicated Index-subclasses
154
148
@overload
@@ -160,7 +154,6 @@ class Index(IndexOpsMixin[S1]):
160
154
copy : bool = ...,
161
155
name : Hashable = ...,
162
156
tupleize_cols : bool = ...,
163
- ** kwargs ,
164
157
) -> DatetimeIndex : ...
165
158
@overload
166
159
def __new__ (
@@ -171,7 +164,6 @@ class Index(IndexOpsMixin[S1]):
171
164
copy : bool = ...,
172
165
name : Hashable = ...,
173
166
tupleize_cols : bool = ...,
174
- ** kwargs ,
175
167
) -> DatetimeIndex : ...
176
168
@overload
177
169
def __new__ (
@@ -182,7 +174,6 @@ class Index(IndexOpsMixin[S1]):
182
174
copy : bool = ...,
183
175
name : Hashable = ...,
184
176
tupleize_cols : bool = ...,
185
- ** kwargs ,
186
177
) -> PeriodIndex : ...
187
178
@overload
188
179
def __new__ (
@@ -193,7 +184,6 @@ class Index(IndexOpsMixin[S1]):
193
184
copy : bool = ...,
194
185
name : Hashable = ...,
195
186
tupleize_cols : bool = ...,
196
- ** kwargs ,
197
187
) -> PeriodIndex : ...
198
188
@overload
199
189
def __new__ (
@@ -204,7 +194,6 @@ class Index(IndexOpsMixin[S1]):
204
194
copy : bool = ...,
205
195
name : Hashable = ...,
206
196
tupleize_cols : bool = ...,
207
- ** kwargs ,
208
197
) -> TimedeltaIndex : ...
209
198
@overload
210
199
def __new__ (
@@ -215,7 +204,6 @@ class Index(IndexOpsMixin[S1]):
215
204
copy : bool = ...,
216
205
name : Hashable = ...,
217
206
tupleize_cols : bool = ...,
218
- ** kwargs ,
219
207
) -> TimedeltaIndex : ...
220
208
@overload
221
209
def __new__ (
@@ -226,7 +214,6 @@ class Index(IndexOpsMixin[S1]):
226
214
copy : bool = ...,
227
215
name : Hashable = ...,
228
216
tupleize_cols : bool = ...,
229
- ** kwargs ,
230
217
) -> IntervalIndex [Interval [_OrderableT ]]: ...
231
218
@overload
232
219
def __new__ (
@@ -237,7 +224,6 @@ class Index(IndexOpsMixin[S1]):
237
224
copy : bool = ...,
238
225
name : Hashable = ...,
239
226
tupleize_cols : bool = ...,
240
- ** kwargs ,
241
227
) -> IntervalIndex [Interval [Any ]]: ...
242
228
# generic overloads
243
229
@overload
@@ -249,7 +235,6 @@ class Index(IndexOpsMixin[S1]):
249
235
copy : bool = ...,
250
236
name : Hashable = ...,
251
237
tupleize_cols : bool = ...,
252
- ** kwargs ,
253
238
) -> Self : ...
254
239
@overload
255
240
def __new__ (
@@ -260,19 +245,17 @@ class Index(IndexOpsMixin[S1]):
260
245
copy : bool = ...,
261
246
name : Hashable = ...,
262
247
tupleize_cols : bool = ...,
263
- ** kwargs ,
264
248
) -> Self : ...
265
249
# fallback overload
266
250
@overload
267
251
def __new__ (
268
252
cls ,
269
253
data : AxesData ,
270
254
* ,
271
- dtype = ...,
255
+ dtype : Dtype = ...,
272
256
copy : bool = ...,
273
257
name : Hashable = ...,
274
258
tupleize_cols : bool = ...,
275
- ** kwargs ,
276
259
) -> Self : ...
277
260
@property
278
261
def str (
@@ -476,6 +459,8 @@ class Index(IndexOpsMixin[S1]):
476
459
def __lt__ (self , other : Self | S1 ) -> np_1darray [np .bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
477
460
def __gt__ (self , other : Self | S1 ) -> np_1darray [np .bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
478
461
# overwrite inherited methods from OpsMixin
462
+ def __sub__ (self , other : Any ) -> Self : ...
463
+ def __rsub__ (self , other : Any ) -> Self : ...
479
464
@overload
480
465
def __mul__ (
481
466
self : Index [int ] | Index [float ], other : timedelta
@@ -524,8 +509,6 @@ class Index(IndexOpsMixin[S1]):
524
509
) -> Self : ...
525
510
def infer_objects (self , copy : bool = True ) -> Self : ...
526
511
527
- UnknownIndex : TypeAlias = Index [Any ]
528
-
529
512
@type_check_only
530
513
class _IndexSubclassBase (Index [S1 ], Generic [S1 , GenericT_co ]):
531
514
@overload
0 commit comments