Skip to content

Commit e20a060

Browse files
committed
wip
1 parent 2bc8049 commit e20a060

File tree

15 files changed

+460
-287
lines changed

15 files changed

+460
-287
lines changed

pandas-stubs/_libs/missing.pyi

Lines changed: 83 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,77 @@ from typing import (
55
overload,
66
)
77

8-
from pandas import (
9-
Index,
10-
Series,
11-
)
128
from pandas.core.arrays.boolean import BooleanArray
9+
from pandas.core.indexes.base import Index
10+
from pandas.core.series import Series
1311
from typing_extensions import Self
1412

13+
from pandas._typing import (
14+
S1,
15+
A1N_co,
16+
)
17+
1518
class NAType:
1619
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
1720
def __format__(self, format_spec: str) -> str: ...
1821
def __hash__(self) -> int: ...
1922
def __reduce__(self) -> str: ...
2023
@overload
2124
def __add__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
22-
self, other: Series, /
23-
) -> Series: ...
25+
self, other: Series[S1, A1N_co], /
26+
) -> Series[S1, A1N_co]: ...
27+
@overload
28+
def __add__(self, other: Series, /) -> Series: ...
2429
@overload
2530
def __add__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
2631
@overload
2732
def __add__(self, other: object, /) -> NAType: ...
2833
@overload
2934
def __radd__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
30-
self, other: Series, /
31-
) -> Series: ...
35+
self, other: Series[S1, A1N_co], /
36+
) -> Series[S1, A1N_co]: ...
37+
@overload
38+
def __radd__(self, other: Series, /) -> Series: ...
3239
@overload
3340
def __radd__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
3441
@overload
3542
def __radd__(self, other: object, /) -> NAType: ...
3643
@overload
3744
def __sub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
38-
self, other: Series, /
39-
) -> Series: ...
45+
self, other: Series[S1, A1N_co], /
46+
) -> Series[S1, A1N_co]: ...
47+
@overload
48+
def __sub__(self, other: Series, /) -> Series: ...
4049
@overload
4150
def __sub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
4251
@overload
4352
def __sub__(self, other: object, /) -> NAType: ...
4453
@overload
4554
def __rsub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
46-
self, other: Series, /
47-
) -> Series: ...
55+
self, other: Series[S1, A1N_co], /
56+
) -> Series[S1, A1N_co]: ...
57+
@overload
58+
def __rsub__(self, other: Series, /) -> Series: ...
4859
@overload
4960
def __rsub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
5061
@overload
5162
def __rsub__(self, other: object, /) -> NAType: ...
5263
@overload
5364
def __mul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
54-
self, other: Series, /
55-
) -> Series: ...
65+
self, other: Series[S1, A1N_co], /
66+
) -> Series[S1, A1N_co]: ...
67+
@overload
68+
def __mul__(self, other: Series, /) -> Series: ...
5669
@overload
5770
def __mul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
5871
@overload
5972
def __mul__(self, other: object, /) -> NAType: ...
6073
@overload
6174
def __rmul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
62-
self, other: Series, /
63-
) -> Series: ...
75+
self, other: Series[S1, A1N_co], /
76+
) -> Series[S1, A1N_co]: ...
77+
@overload
78+
def __rmul__(self, other: Series, /) -> Series: ...
6479
@overload
6580
def __rmul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
6681
@overload
@@ -69,48 +84,60 @@ class NAType:
6984
def __rmatmul__(self, other: object, /) -> NAType: ...
7085
@overload
7186
def __truediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
72-
self, other: Series, /
73-
) -> Series: ...
87+
self, other: Series[S1, A1N_co], /
88+
) -> Series[S1, A1N_co]: ...
89+
@overload
90+
def __truediv__(self, other: Series, /) -> Series: ...
7491
@overload
7592
def __truediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
7693
@overload
7794
def __truediv__(self, other: object, /) -> NAType: ...
7895
@overload
7996
def __rtruediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
80-
self, other: Series, /
81-
) -> Series: ...
97+
self, other: Series[S1, A1N_co], /
98+
) -> Series[S1, A1N_co]: ...
99+
@overload
100+
def __rtruediv__(self, other: Series, /) -> Series: ...
82101
@overload
83102
def __rtruediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
84103
@overload
85104
def __rtruediv__(self, other: object, /) -> NAType: ...
86105
@overload
87106
def __floordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
88-
self, other: Series, /
89-
) -> Series: ...
107+
self, other: Series[S1, A1N_co], /
108+
) -> Series[S1, A1N_co]: ...
109+
@overload
110+
def __floordiv__(self, other: Series, /) -> Series: ...
90111
@overload
91112
def __floordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
92113
@overload
93114
def __floordiv__(self, other: object, /) -> NAType: ...
94115
@overload
95116
def __rfloordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
96-
self, other: Series, /
97-
) -> Series: ...
117+
self, other: Series[S1, A1N_co], /
118+
) -> Series[S1, A1N_co]: ...
119+
@overload
120+
def __rfloordiv__(self, other: Series, /) -> Series: ...
98121
@overload
99122
def __rfloordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
100123
@overload
101124
def __rfloordiv__(self, other: object, /) -> NAType: ...
102125
@overload
103126
def __mod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
104-
self, other: Series, /
105-
) -> Series: ...
127+
self, other: Series[S1, A1N_co], /
128+
) -> Series[S1, A1N_co]: ...
129+
@overload
130+
def __mod__(self, other: Series, /) -> Series: ...
106131
@overload
107132
def __mod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
108133
@overload
109134
def __mod__(self, other: object, /) -> NAType: ...
110135
@overload
111136
def __rmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
112-
self, other: Series, /
113-
) -> Series: ...
137+
self, other: Series[S1, A1N_co], /
138+
) -> Series[S1, A1N_co]: ...
139+
@overload
140+
def __rmod__(self, other: Series, /) -> Series: ...
114141
@overload
115142
def __rmod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
116143
@overload
@@ -133,8 +160,8 @@ class NAType:
133160
def __rdivmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
134161
@overload # type: ignore[override]
135162
def __eq__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
136-
self, other: Series, /
137-
) -> Series[bool]: ...
163+
self, other: Series[Any, Any], /
164+
) -> Series[bool, BooleanArray]: ...
138165
@overload
139166
def __eq__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
140167
@overload
@@ -143,8 +170,8 @@ class NAType:
143170
) -> NAType: ...
144171
@overload # type: ignore[override]
145172
def __ne__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
146-
self, other: Series, /
147-
) -> Series[bool]: ...
173+
self, other: Series[Any, Any], /
174+
) -> Series[bool, BooleanArray]: ...
148175
@overload
149176
def __ne__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
150177
@overload
@@ -153,32 +180,32 @@ class NAType:
153180
) -> NAType: ...
154181
@overload
155182
def __le__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
156-
self, other: Series, /
157-
) -> Series[bool]: ...
183+
self, other: Series[Any, Any], /
184+
) -> Series[bool, BooleanArray]: ...
158185
@overload
159186
def __le__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
160187
@overload
161188
def __le__(self, other: object, /) -> NAType: ...
162189
@overload
163190
def __lt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
164-
self, other: Series, /
165-
) -> Series[bool]: ...
191+
self, other: Series[Any, Any], /
192+
) -> Series[bool, BooleanArray]: ...
166193
@overload
167194
def __lt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
168195
@overload
169196
def __lt__(self, other: object, /) -> NAType: ...
170197
@overload
171198
def __gt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
172-
self, other: Series, /
173-
) -> Series[bool]: ...
199+
self, other: Series[Any, Any], /
200+
) -> Series[bool, BooleanArray]: ...
174201
@overload
175202
def __gt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
176203
@overload
177204
def __gt__(self, other: object, /) -> NAType: ...
178205
@overload
179206
def __ge__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
180-
self, other: Series, /
181-
) -> Series[bool]: ...
207+
self, other: Series[Any, Any], /
208+
) -> Series[bool, BooleanArray]: ...
182209
@overload
183210
def __ge__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
184211
@overload
@@ -189,16 +216,20 @@ class NAType:
189216
def __invert__(self) -> NAType: ...
190217
@overload
191218
def __pow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
192-
self, other: Series, /
193-
) -> Series: ...
219+
self, other: Series[S1, A1N_co], /
220+
) -> Series[S1, A1N_co]: ...
221+
@overload
222+
def __pow__(self, other: Series, /) -> Series: ...
194223
@overload
195224
def __pow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
196225
@overload
197226
def __pow__(self, other: object, /) -> NAType: ...
198227
@overload
199228
def __rpow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
200-
self, other: Series, /
201-
) -> Series: ...
229+
self, other: Series[S1, A1N_co], /
230+
) -> Series[S1, A1N_co]: ...
231+
@overload
232+
def __rpow__(self, other: Series, /) -> Series: ...
202233
@overload
203234
def __rpow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
204235
@overload
@@ -221,16 +252,20 @@ class NAType:
221252
def __ror__(self, other: bool | NAType, /) -> NAType: ...
222253
@overload
223254
def __xor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
224-
self, other: Series, /
225-
) -> Series: ...
255+
self, other: Series[S1, A1N_co], /
256+
) -> Series[S1, A1N_co]: ...
257+
@overload
258+
def __xor__(self, other: Series, /) -> Series: ...
226259
@overload
227260
def __xor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
228261
@overload
229262
def __xor__(self, other: object, /) -> NAType: ...
230263
@overload
231264
def __rxor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
232-
self, other: Series, /
233-
) -> Series: ...
265+
self, other: Series[S1, A1N_co], /
266+
) -> Series[S1, A1N_co]: ...
267+
@overload
268+
def __rxor__(self, other: Series, /) -> Series: ...
234269
@overload
235270
def __rxor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
236271
@overload

0 commit comments

Comments
 (0)