code: def _is_value_better(self, new_value: float) -> bool:
          
          if self._best_value is None:
              return True
          if self._condition == 'min':
              return new_value < self._best_value
          if self._condition == 'max':
              return new_value > self._best_value
docs: Test if the new value is better than the best so far.
  
          :param new_value: current value of the objective function