Skip to content

Commit

Permalink
Don't remove the correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
alippai committed Oct 3, 2024
1 parent 7a4bee7 commit 1bad029
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ from pandas._typing import npt

from pandas.tseries.holiday import AbstractHolidayCalendar

_DatetimeT = TypeVar("_DatetimeT", bound=date)
_DatetimeT = TypeVar("_DatetimeT", bound=datetime)
_TimedeltaT = TypeVar("_TimedeltaT", bound=timedelta)

prefix_mapping: dict[str, type]
Expand All @@ -43,31 +43,33 @@ class BaseOffset:
@overload
def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
@overload
def __add__(self, other: _DatetimeT) -> _DatetimeT: ...
@overload
def __add__(self, other: date) -> Timestamp: ...
@overload
def __add__(self, other: BaseOffset) -> Self: ...
@overload
def __add__(self, other: _DatetimeT) -> _DatetimeT: ...
@overload
def __add__(self, other: _TimedeltaT) -> _TimedeltaT: ...
@overload
def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
@overload
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...
@overload
def __radd__(self, other: date) -> Timestamp: ...
@overload
def __radd__(self, other: BaseOffset) -> Self: ...
@overload
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...
@overload
def __radd__(self, other: _TimedeltaT) -> _TimedeltaT: ...
def __sub__(self, other: BaseOffset) -> Self: ...
@overload
def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
@overload
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
@overload
def __rsub__(self, other: date) -> Timestamp: ...
@overload
def __rsub__(self, other: BaseOffset) -> Self: ...
@overload
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
@overload
def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...
def __call__(self, other): ...
@overload
Expand Down

0 comments on commit 1bad029

Please sign in to comment.