Subtract two dates, or a date and a timedelta.
(self, other)
| 1221 | __radd__ = __add__ |
| 1222 | |
| 1223 | def __sub__(self, other): |
| 1224 | """Subtract two dates, or a date and a timedelta.""" |
| 1225 | if isinstance(other, timedelta): |
| 1226 | return self + timedelta(-other.days) |
| 1227 | if isinstance(other, date): |
| 1228 | days1 = self.toordinal() |
| 1229 | days2 = other.toordinal() |
| 1230 | return timedelta(days1 - days2) |
| 1231 | return NotImplemented |
| 1232 | |
| 1233 | def weekday(self): |
| 1234 | "Return day of the week, where Monday == 0 ... Sunday == 6." |
nothing calls this directly
no test coverage detected