docs: def date_to_number(self, date):
          """
          Converts a date or datetime instance to a corresponding float value.
          """
          if isinstance(date, datetime.datetime):
              delta = date - self._null_date
          elif isinstance(date, datetime.date):
              delta = date - self._null_date.date()
          else:
              raise TypeError(date)
          return delta.days + delta.seconds / (24.0 * 60 * 60)