parameters: (self, other)
return_statement: return NotImplemented
docstring: Subtract two dates, or a date and a timedelta.
docstring_summary: Subtract two dates, or a date and a timedelta.
docstring_tokens: Subtract two dates or a date and a timedelta .
function: def __sub__(self, other):
          """Subtract two dates, or a date and a timedelta."""
          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
function_tokens: 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