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 (
4848 HashableT ,
4949 Label ,
5050 Level ,
51+ MaskType ,
5152 NaPosition ,
5253 TimedeltaDtypeArg ,
5354 TimestampDtypeArg ,
@@ -368,15 +369,7 @@ class Index(IndexOpsMixin[S1]):
368369 @overload
369370 def __getitem__ (
370371 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 ,
380373 ) -> Self : ...
381374 @overload
382375 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
1313from pandas import Index
1414from pandas .core .indexes .extension import ExtensionIndex
1515from pandas .core .series import (
16- Series ,
1716 TimedeltaSeries ,
1817 TimestampSeries ,
1918)
@@ -31,6 +30,7 @@ from pandas._typing import (
3130 IntervalClosedType ,
3231 IntervalT ,
3332 Label ,
33+ MaskType ,
3434 np_ndarray_anyint ,
3535 np_ndarray_bool ,
3636 npt ,
@@ -254,7 +254,7 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
254254 | np_ndarray_anyint
255255 | Sequence [int ]
256256 | Index
257- | Series [ bool ]
257+ | MaskType
258258 | np_ndarray_bool
259259 ),
260260 ) -> IntervalIndex [IntervalT ]: ...
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ from pandas._typing import (
1818 Dtype ,
1919 DtypeArg ,
2020 HashableT ,
21+ MaskType ,
2122 np_ndarray_anyint ,
2223 np_ndarray_bool ,
2324)
@@ -114,15 +115,7 @@ class MultiIndex(Index[Any]):
114115 @overload # type: ignore[override]
115116 def __getitem__ (
116117 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 ,
126119 ) -> Self : ...
127120 @overload
128121 def __getitem__ ( # pyright: ignore[reportIncompatibleMethodOverride]
Original file line number Diff line number Diff line change @@ -2,13 +2,12 @@ from collections.abc import Sequence
22from typing import overload
33
44import numpy as np
5- from pandas import Series
65from pandas .core .indexes .base import Index
76
87from pandas ._typing import (
98 HashableT ,
9+ MaskType ,
1010 np_ndarray_anyint ,
11- np_ndarray_bool ,
1211 npt ,
1312)
1413
@@ -73,15 +72,7 @@ class RangeIndex(Index[int]):
7372 @overload # type: ignore[override]
7473 def __getitem__ (
7574 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 ,
8576 ) -> Index : ...
8677 @overload
8778 def __getitem__ ( # pyright: ignore[reportIncompatibleMethodOverride]
You can’t perform that action at this time.
0 commit comments