code: def duration(self):
          
          if self._duration:
              return self._duration
          elif self.due:
              return self.due - self.begin
          else:
              # todo has neither due, nor start and duration
              return None
docs: Get or set the duration of the todo.
  
          |  Will return a timedelta object.
          |  May be set to anything that timedelta() understands.
          |  May be set with a dict ({"days":2, "hours":6}).
          |  If set to a non null value, removes any already
              existing end time.