code: def is_outside_bounds(self, val):
      
      return ((self.lower_bound is not None and val < self.lower_bound) or
              (self.upper_bound is not None and val > self.upper_bound))
docs: Returns whether the value is outside the bounds or not.