Skip to content

Commit 5aa84b0

Browse files
committed
wip
1 parent 550186b commit 5aa84b0

File tree

8 files changed

+207
-222
lines changed

8 files changed

+207
-222
lines changed

pandas-stubs/_typing.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,9 +1025,6 @@ S1 = TypeVar("S1", bound=SeriesDType, default=Any)
10251025
# Like S0 and S1, but without `default=Any`.
10261026
S2 = TypeVar("S2", bound=SeriesDType)
10271027
S2_contra = TypeVar("S2_contra", bound=SeriesDType, contravariant=True)
1028-
S2_NDT_contra = TypeVar(
1029-
"S2_NDT_contra", bound=SeriesDTypeNoDateTime, contravariant=True
1030-
)
10311028
S2_NSDT = TypeVar("S2_NSDT", bound=SeriesDTypeNoStrDateTime)
10321029
S3 = TypeVar("S3", bound=SeriesDType)
10331030

pandas-stubs/core/base.pyi

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ from pandas._typing import (
4545
SupportsDType,
4646
np_1darray,
4747
np_1darray_intp,
48-
np_ndarray,
4948
np_ndarray_anyint,
50-
np_ndarray_bool,
5149
np_ndarray_complex,
5250
np_ndarray_float,
5351
np_ndarray_td,
@@ -236,16 +234,6 @@ ScalarArrayIndexSeriesTimedelta: TypeAlias = (
236234
ScalarArrayIndexTimedelta | Series[Timedelta]
237235
)
238236

239-
NumListLike: TypeAlias = ( # TODO: pandas-dev/pandas-stubs#1474 deprecated, do not use
240-
ExtensionArray
241-
| np_ndarray_bool
242-
| np_ndarray_anyint
243-
| np_ndarray_float
244-
| np_ndarray_complex
245-
| dict[str, np_ndarray]
246-
| Sequence[complex]
247-
)
248-
249237
@type_check_only
250238
class ElementOpsMixin(Generic[S2]):
251239
@overload
@@ -285,6 +273,30 @@ class ElementOpsMixin(Generic[S2]):
285273
@overload
286274
def _proto_radd(self: ElementOpsMixin[str], other: str) -> ElementOpsMixin[str]: ...
287275
@overload
276+
def _proto_sub(
277+
self: ElementOpsMixin[int], other: int | np.integer
278+
) -> ElementOpsMixin[int]: ...
279+
@overload
280+
def _proto_sub(
281+
self: ElementOpsMixin[float], other: float | np.floating
282+
) -> ElementOpsMixin[float]: ...
283+
@overload
284+
def _proto_sub(
285+
self: ElementOpsMixin[complex], other: complex | np.complexfloating
286+
) -> ElementOpsMixin[complex]: ...
287+
@overload
288+
def _proto_rsub(
289+
self: ElementOpsMixin[int], other: int | np.integer
290+
) -> ElementOpsMixin[int]: ...
291+
@overload
292+
def _proto_rsub(
293+
self: ElementOpsMixin[float], other: float | np.floating
294+
) -> ElementOpsMixin[float]: ...
295+
@overload
296+
def _proto_rsub(
297+
self: ElementOpsMixin[complex], other: complex | np.complexfloating
298+
) -> ElementOpsMixin[complex]: ...
299+
@overload
288300
def _proto_mul(
289301
self: ElementOpsMixin[bool], other: bool | np.bool_
290302
) -> ElementOpsMixin[bool]: ...
@@ -399,6 +411,14 @@ class Supports_ProtoAdd(Protocol[T_contra, S2]):
399411
class Supports_ProtoRAdd(Protocol[T_contra, S2]):
400412
def _proto_radd(self, other: T_contra, /) -> ElementOpsMixin[S2]: ...
401413

414+
@type_check_only
415+
class Supports_ProtoSub(Protocol[T_contra, S2]):
416+
def _proto_sub(self, other: T_contra, /) -> ElementOpsMixin[S2]: ...
417+
418+
@type_check_only
419+
class Supports_ProtoRSub(Protocol[T_contra, S2]):
420+
def _proto_rsub(self, other: T_contra, /) -> ElementOpsMixin[S2]: ...
421+
402422
@type_check_only
403423
class Supports_ProtoMul(Protocol[T_contra, S2]):
404424
def _proto_mul(self, other: T_contra, /) -> ElementOpsMixin[S2]: ...

0 commit comments

Comments
 (0)