| 1215 | return other.diff(self, False) |
| 1216 | |
| 1217 | def __rsub__(self, other: datetime.datetime) -> Interval[datetime.datetime]: |
| 1218 | if not isinstance(other, datetime.datetime): |
| 1219 | return NotImplemented |
| 1220 | |
| 1221 | if not isinstance(other, self.__class__): |
| 1222 | if other.tzinfo is None: |
| 1223 | other = pendulum.naive( |
| 1224 | other.year, |
| 1225 | other.month, |
| 1226 | other.day, |
| 1227 | other.hour, |
| 1228 | other.minute, |
| 1229 | other.second, |
| 1230 | other.microsecond, |
| 1231 | ) |
| 1232 | else: |
| 1233 | other = self.instance(other) |
| 1234 | |
| 1235 | return self.diff(other, False) |
| 1236 | |
| 1237 | def __add__(self, other: datetime.timedelta) -> Self: |
| 1238 | if not isinstance(other, datetime.timedelta): |