Add a datetime and a timedelta.
(self, other)
| 2327 | return diff and 1 or 0 |
| 2328 | |
| 2329 | def __add__(self, other): |
| 2330 | "Add a datetime and a timedelta." |
| 2331 | if not isinstance(other, timedelta): |
| 2332 | return NotImplemented |
| 2333 | delta = timedelta(self.toordinal(), |
| 2334 | hours=self._hour, |
| 2335 | minutes=self._minute, |
| 2336 | seconds=self._second, |
| 2337 | microseconds=self._microsecond) |
| 2338 | delta += other |
| 2339 | hour, rem = divmod(delta.seconds, 3600) |
| 2340 | minute, second = divmod(rem, 60) |
| 2341 | if 0 < delta.days <= _MAXORDINAL: |
| 2342 | return type(self).combine(date.fromordinal(delta.days), |
| 2343 | time(hour, minute, second, |
| 2344 | delta.microseconds, |
| 2345 | tzinfo=self._tzinfo)) |
| 2346 | raise OverflowError("result out of range") |
| 2347 | |
| 2348 | __radd__ = __add__ |
| 2349 |
nothing calls this directly
no test coverage detected