Skip to content

Commit a6faa39

Browse files
committed
simplify missing
1 parent 8a52340 commit a6faa39

File tree

1 file changed

+91
-130
lines changed

1 file changed

+91
-130
lines changed

pandas-stubs/_libs/missing.pyi

Lines changed: 91 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -5,236 +5,197 @@ from typing import (
55
overload,
66
)
77

8-
from pandas import (
9-
Index,
10-
Series,
11-
)
8+
import numpy as np
129
from pandas.core.arrays.boolean import BooleanArray
10+
from pandas.core.indexes.base import Index
11+
from pandas.core.series import Series
1312
from typing_extensions import Self
1413

14+
from pandas._typing import Scalar
15+
1516
class NAType:
1617
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
1718
def __format__(self, format_spec: str) -> str: ...
1819
def __hash__(self) -> int: ...
1920
def __reduce__(self) -> str: ...
2021
@overload
21-
def __add__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
22-
self, other: Series, /
23-
) -> Series: ...
22+
def __add__(self, other: Series, /) -> Series: ...
2423
@overload
25-
def __add__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
24+
def __add__(self, other: Index, /) -> Index: ...
2625
@overload
27-
def __add__(self, other: object, /) -> NAType: ...
26+
def __add__(self, other: Scalar, /) -> NAType: ...
2827
@overload
29-
def __radd__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
30-
self, other: Series, /
31-
) -> Series: ...
28+
def __radd__(self, other: Series, /) -> Series: ...
3229
@overload
33-
def __radd__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
30+
def __radd__(self, other: Index, /) -> Index: ...
3431
@overload
35-
def __radd__(self, other: object, /) -> NAType: ...
32+
def __radd__(self, other: Scalar, /) -> NAType: ...
3633
@overload
37-
def __sub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
38-
self, other: Series, /
39-
) -> Series: ...
34+
def __sub__(self, other: Series, /) -> Series: ...
4035
@overload
41-
def __sub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
36+
def __sub__(self, other: Index, /) -> Index: ...
4237
@overload
43-
def __sub__(self, other: object, /) -> NAType: ...
38+
def __sub__(self, other: Scalar, /) -> NAType: ...
4439
@overload
45-
def __rsub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
46-
self, other: Series, /
47-
) -> Series: ...
40+
def __rsub__(self, other: Series, /) -> Series: ...
4841
@overload
49-
def __rsub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
42+
def __rsub__(self, other: Index, /) -> Index: ...
5043
@overload
51-
def __rsub__(self, other: object, /) -> NAType: ...
44+
def __rsub__(self, other: Scalar, /) -> NAType: ...
5245
@overload
53-
def __mul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
54-
self, other: Series, /
55-
) -> Series: ...
46+
def __mul__(self, other: Series, /) -> Series: ...
5647
@overload
57-
def __mul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
48+
def __mul__(self, other: Index, /) -> Index: ...
5849
@overload
59-
def __mul__(self, other: object, /) -> NAType: ...
50+
def __mul__(self, other: Scalar, /) -> NAType: ...
6051
@overload
61-
def __rmul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
62-
self, other: Series, /
63-
) -> Series: ...
52+
def __rmul__(self, other: Series, /) -> Series: ...
6453
@overload
65-
def __rmul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
54+
def __rmul__(self, other: Index, /) -> Index: ...
6655
@overload
67-
def __rmul__(self, other: object, /) -> NAType: ...
68-
def __matmul__(self, other: object, /) -> NAType: ...
69-
def __rmatmul__(self, other: object, /) -> NAType: ...
56+
def __rmul__(self, other: Scalar, /) -> NAType: ...
57+
def __matmul__(self, other: Scalar, /) -> NAType: ...
58+
def __rmatmul__(self, other: Scalar, /) -> NAType: ...
7059
@overload
71-
def __truediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
72-
self, other: Series, /
73-
) -> Series: ...
60+
def __truediv__(self, other: Series, /) -> Series: ...
7461
@overload
75-
def __truediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
62+
def __truediv__(self, other: Index, /) -> Index: ...
7663
@overload
77-
def __truediv__(self, other: object, /) -> NAType: ...
64+
def __truediv__(self, other: Scalar, /) -> NAType: ...
7865
@overload
79-
def __rtruediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
80-
self, other: Series, /
81-
) -> Series: ...
66+
def __rtruediv__(self, other: Series, /) -> Series: ...
8267
@overload
83-
def __rtruediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
68+
def __rtruediv__(self, other: Index, /) -> Index: ...
8469
@overload
85-
def __rtruediv__(self, other: object, /) -> NAType: ...
70+
def __rtruediv__(self, other: Scalar, /) -> NAType: ...
8671
@overload
87-
def __floordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
88-
self, other: Series, /
89-
) -> Series: ...
72+
def __floordiv__(self, other: Series, /) -> Series: ...
9073
@overload
91-
def __floordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
74+
def __floordiv__(self, other: Index, /) -> Index: ...
9275
@overload
93-
def __floordiv__(self, other: object, /) -> NAType: ...
76+
def __floordiv__(self, other: Scalar, /) -> NAType: ...
9477
@overload
95-
def __rfloordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
96-
self, other: Series, /
97-
) -> Series: ...
78+
def __rfloordiv__(self, other: Series, /) -> Series: ...
9879
@overload
99-
def __rfloordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
80+
def __rfloordiv__(self, other: Index, /) -> Index: ...
10081
@overload
101-
def __rfloordiv__(self, other: object, /) -> NAType: ...
82+
def __rfloordiv__(self, other: Scalar, /) -> NAType: ...
10283
@overload
103-
def __mod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
104-
self, other: Series, /
105-
) -> Series: ...
84+
def __mod__(self, other: Series, /) -> Series: ...
10685
@overload
107-
def __mod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
86+
def __mod__(self, other: Index, /) -> Index: ...
10887
@overload
109-
def __mod__(self, other: object, /) -> NAType: ...
88+
def __mod__(self, other: Scalar, /) -> NAType: ...
11089
@overload
111-
def __rmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
112-
self, other: Series, /
113-
) -> Series: ...
90+
def __rmod__(self, other: Series, /) -> Series: ...
11491
@overload
115-
def __rmod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
92+
def __rmod__(self, other: Index, /) -> Index: ...
11693
@overload
117-
def __rmod__(self, other: object, /) -> NAType: ...
94+
def __rmod__(self, other: Scalar, /) -> NAType: ...
11895
@overload
119-
def __divmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
120-
self, other: Series, /
121-
) -> tuple[Series, Series]: ...
96+
def __divmod__(self, other: Series, /) -> tuple[Series, Series]: ...
12297
@overload
123-
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
98+
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ...
12499
@overload
125-
def __divmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
100+
def __divmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
126101
@overload
127-
def __rdivmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
128-
self, other: Series, /
129-
) -> tuple[Series, Series]: ...
102+
def __rdivmod__(self, other: Series, /) -> tuple[Series, Series]: ...
130103
@overload
131-
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
104+
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ...
132105
@overload
133-
def __rdivmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
106+
def __rdivmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
134107
@overload # type: ignore[override]
135-
def __eq__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
136-
self, other: Series, /
137-
) -> Series[bool]: ...
108+
def __eq__(self, other: Series, /) -> Series[bool]: ...
138109
@overload
139-
def __eq__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
110+
def __eq__(self, other: Index, /) -> BooleanArray: ...
140111
@overload
141112
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
142-
self, other: object, /
113+
self, other: Scalar, /
143114
) -> NAType: ...
144115
@overload # type: ignore[override]
145-
def __ne__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
146-
self, other: Series, /
147-
) -> Series[bool]: ...
116+
def __ne__(self, other: Series, /) -> Series[bool]: ...
148117
@overload
149-
def __ne__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
118+
def __ne__(self, other: Index, /) -> BooleanArray: ...
150119
@overload
151120
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
152-
self, other: object, /
121+
self, other: Scalar, /
153122
) -> NAType: ...
154123
@overload
155-
def __le__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
156-
self, other: Series, /
157-
) -> Series[bool]: ...
124+
def __le__(self, other: Series, /) -> Series[bool]: ...
158125
@overload
159-
def __le__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
126+
def __le__(self, other: Index, /) -> BooleanArray: ...
160127
@overload
161-
def __le__(self, other: object, /) -> NAType: ...
128+
def __le__(self, other: Scalar, /) -> NAType: ...
162129
@overload
163-
def __lt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
164-
self, other: Series, /
165-
) -> Series[bool]: ...
130+
def __lt__(self, other: Series, /) -> Series[bool]: ...
166131
@overload
167-
def __lt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
132+
def __lt__(self, other: Index, /) -> BooleanArray: ...
168133
@overload
169-
def __lt__(self, other: object, /) -> NAType: ...
134+
def __lt__(self, other: Scalar, /) -> NAType: ...
170135
@overload
171-
def __gt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
172-
self, other: Series, /
173-
) -> Series[bool]: ...
136+
def __gt__(self, other: Series, /) -> Series[bool]: ...
174137
@overload
175-
def __gt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
138+
def __gt__(self, other: Index, /) -> BooleanArray: ...
176139
@overload
177-
def __gt__(self, other: object, /) -> NAType: ...
140+
def __gt__(self, other: Scalar, /) -> NAType: ...
178141
@overload
179-
def __ge__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
180-
self, other: Series, /
181-
) -> Series[bool]: ...
142+
def __ge__(self, other: Series, /) -> Series[bool]: ...
182143
@overload
183-
def __ge__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
144+
def __ge__(self, other: Index, /) -> BooleanArray: ...
184145
@overload
185-
def __ge__(self, other: object, /) -> NAType: ...
146+
def __ge__(self, other: Scalar, /) -> NAType: ...
186147
def __neg__(self) -> NAType: ...
187148
def __pos__(self) -> NAType: ...
188149
def __abs__(self) -> NAType: ...
189150
def __invert__(self) -> NAType: ...
190151
@overload
191-
def __pow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
192-
self, other: Series, /
193-
) -> Series: ...
152+
def __pow__(self, other: Series, /) -> Series: ...
194153
@overload
195-
def __pow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
154+
def __pow__(self, other: Index, /) -> Index: ...
196155
@overload
197-
def __pow__(self, other: object, /) -> NAType: ...
156+
def __pow__(self, other: complex, /) -> NAType: ...
198157
@overload
199-
def __rpow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
200-
self, other: Series, /
201-
) -> Series: ...
158+
def __rpow__(self, other: Series, /) -> Series: ...
202159
@overload
203-
def __rpow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
160+
def __rpow__(self, other: Index, /) -> Index: ...
204161
@overload
205-
def __rpow__(self, other: object, /) -> NAType: ...
162+
def __rpow__(self, other: complex, /) -> NAType: ...
206163
@overload
207-
def __and__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
164+
def __and__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
165+
self, other: Literal[False], /
166+
) -> Literal[False]: ...
208167
@overload
209168
def __and__(self, other: bool | NAType, /) -> NAType: ...
210169
@overload
211-
def __rand__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
170+
def __rand__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
171+
self, other: Literal[False], /
172+
) -> Literal[False]: ...
212173
@overload
213174
def __rand__(self, other: bool, /) -> NAType: ...
214175
@overload
215-
def __or__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
176+
def __or__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
177+
self, other: Literal[True], /
178+
) -> Literal[True]: ...
216179
@overload
217180
def __or__(self, other: bool | NAType, /) -> NAType: ...
218181
@overload
219-
def __ror__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
182+
def __ror__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
183+
self, other: Literal[True], /
184+
) -> Literal[True]: ...
220185
@overload
221186
def __ror__(self, other: bool | NAType, /) -> NAType: ...
222187
@overload
223-
def __xor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
224-
self, other: Series, /
225-
) -> Series: ...
188+
def __xor__(self, other: Series, /) -> Series: ...
226189
@overload
227-
def __xor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
190+
def __xor__(self, other: Index, /) -> Index: ...
228191
@overload
229-
def __xor__(self, other: object, /) -> NAType: ...
192+
def __xor__(self, other: bool | np.bool, /) -> NAType: ...
230193
@overload
231-
def __rxor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
232-
self, other: Series, /
233-
) -> Series: ...
194+
def __rxor__(self, other: Series, /) -> Series: ...
234195
@overload
235-
def __rxor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
196+
def __rxor__(self, other: Index, /) -> Index: ...
236197
@overload
237-
def __rxor__(self, other: object, /) -> NAType: ...
198+
def __rxor__(self, other: bool | np.bool, /) -> NAType: ...
238199
__array_priority__: int
239200
def __array_ufunc__(
240201
self, ufunc: Callable[..., Any], method: str, *inputs: Any, **kwargs: Any

0 commit comments

Comments
 (0)