'Subtract two dates, or a date and a timedelta.'

def __sub__(self, other):

    if isinstance(other, timedelta):
        return (self + timedelta((- other.days)))
    if isinstance(other, date):
        days1 = self.toordinal()
        days2 = other.toordinal()
        return timedelta((days1 - days2))
    return NotImplemented
