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
Subtract two dates, or a date and a timedelta.
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/datetime.py/date.__sub__