File tree Expand file tree Collapse file tree 4 files changed +8
-31
lines changed
pandas-stubs/core/indexes Expand file tree Collapse file tree 4 files changed +8
-31
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ from pandas._typing import (
48
48
HashableT ,
49
49
Label ,
50
50
Level ,
51
+ MaskType ,
51
52
NaPosition ,
52
53
TimedeltaDtypeArg ,
53
54
TimestampDtypeArg ,
@@ -368,15 +369,7 @@ class Index(IndexOpsMixin[S1]):
368
369
@overload
369
370
def __getitem__ (
370
371
self ,
371
- idx : (
372
- slice
373
- | np_ndarray_anyint
374
- | Sequence [int ]
375
- | Index
376
- | Series [bool ]
377
- | Sequence [bool ]
378
- | np_ndarray_bool
379
- ),
372
+ idx : slice | np_ndarray_anyint | Sequence [int ] | Index | MaskType ,
380
373
) -> Self : ...
381
374
@overload
382
375
def __getitem__ (self , idx : int | tuple [np_ndarray_anyint , ...]) -> S1 : ...
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import pandas as pd
13
13
from pandas import Index
14
14
from pandas .core .indexes .extension import ExtensionIndex
15
15
from pandas .core .series import (
16
- Series ,
17
16
TimedeltaSeries ,
18
17
TimestampSeries ,
19
18
)
@@ -31,6 +30,7 @@ from pandas._typing import (
31
30
IntervalClosedType ,
32
31
IntervalT ,
33
32
Label ,
33
+ MaskType ,
34
34
np_ndarray_anyint ,
35
35
np_ndarray_bool ,
36
36
npt ,
@@ -254,7 +254,7 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
254
254
| np_ndarray_anyint
255
255
| Sequence [int ]
256
256
| Index
257
- | Series [ bool ]
257
+ | MaskType
258
258
| np_ndarray_bool
259
259
),
260
260
) -> IntervalIndex [IntervalT ]: ...
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ from pandas._typing import (
18
18
Dtype ,
19
19
DtypeArg ,
20
20
HashableT ,
21
+ MaskType ,
21
22
np_ndarray_anyint ,
22
23
np_ndarray_bool ,
23
24
)
@@ -114,15 +115,7 @@ class MultiIndex(Index[Any]):
114
115
@overload # type: ignore[override]
115
116
def __getitem__ (
116
117
self ,
117
- idx : (
118
- slice
119
- | np_ndarray_anyint
120
- | Sequence [int ]
121
- | Index
122
- | pd .Series [bool ]
123
- | Sequence [bool ]
124
- | np_ndarray_bool
125
- ),
118
+ idx : slice | np_ndarray_anyint | Sequence [int ] | Index | MaskType ,
126
119
) -> Self : ...
127
120
@overload
128
121
def __getitem__ ( # pyright: ignore[reportIncompatibleMethodOverride]
Original file line number Diff line number Diff line change @@ -2,13 +2,12 @@ from collections.abc import Sequence
2
2
from typing import overload
3
3
4
4
import numpy as np
5
- from pandas import Series
6
5
from pandas .core .indexes .base import Index
7
6
8
7
from pandas ._typing import (
9
8
HashableT ,
9
+ MaskType ,
10
10
np_ndarray_anyint ,
11
- np_ndarray_bool ,
12
11
npt ,
13
12
)
14
13
@@ -73,15 +72,7 @@ class RangeIndex(Index[int]):
73
72
@overload # type: ignore[override]
74
73
def __getitem__ (
75
74
self ,
76
- idx : (
77
- slice
78
- | np_ndarray_anyint
79
- | Sequence [int ]
80
- | Index
81
- | Series [bool ]
82
- | Sequence [bool ]
83
- | np_ndarray_bool
84
- ),
75
+ idx : slice | np_ndarray_anyint | Sequence [int ] | Index | MaskType ,
85
76
) -> Index : ...
86
77
@overload
87
78
def __getitem__ ( # pyright: ignore[reportIncompatibleMethodOverride]
You can’t perform that action at this time.
0 commit comments