Skip to content

Commit 1bad029

Browse files
committed
Don't remove the correct type
1 parent 7a4bee7 commit 1bad029

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from pandas._typing import npt
2323

2424
from pandas.tseries.holiday import AbstractHolidayCalendar
2525

26-
_DatetimeT = TypeVar("_DatetimeT", bound=date)
26+
_DatetimeT = TypeVar("_DatetimeT", bound=datetime)
2727
_TimedeltaT = TypeVar("_TimedeltaT", bound=timedelta)
2828

2929
prefix_mapping: dict[str, type]
@@ -43,31 +43,33 @@ class BaseOffset:
4343
@overload
4444
def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
4545
@overload
46+
def __add__(self, other: _DatetimeT) -> _DatetimeT: ...
47+
@overload
4648
def __add__(self, other: date) -> Timestamp: ...
4749
@overload
4850
def __add__(self, other: BaseOffset) -> Self: ...
4951
@overload
50-
def __add__(self, other: _DatetimeT) -> _DatetimeT: ...
51-
@overload
5252
def __add__(self, other: _TimedeltaT) -> _TimedeltaT: ...
5353
@overload
5454
def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
5555
@overload
56+
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...
57+
@overload
5658
def __radd__(self, other: date) -> Timestamp: ...
5759
@overload
5860
def __radd__(self, other: BaseOffset) -> Self: ...
5961
@overload
60-
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...
61-
@overload
6262
def __radd__(self, other: _TimedeltaT) -> _TimedeltaT: ...
63+
def __sub__(self, other: BaseOffset) -> Self: ...
64+
@overload
6365
def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
6466
@overload
67+
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
68+
@overload
6569
def __rsub__(self, other: date) -> Timestamp: ...
6670
@overload
6771
def __rsub__(self, other: BaseOffset) -> Self: ...
6872
@overload
69-
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
70-
@overload
7173
def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...
7274
def __call__(self, other): ...
7375
@overload

0 commit comments

Comments
 (0)