@@ -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
250238class 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]):
399411class 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
403423class Supports_ProtoMul (Protocol [T_contra , S2 ]):
404424 def _proto_mul (self , other : T_contra , / ) -> ElementOpsMixin [S2 ]: ...
0 commit comments