def check(self, value): if self._min_value.startswith('('): if to_float(self._min_value[1:]) >= value: return False elif to_float(self._min_value) > value: return False if self._max_value.startswith('('): if to_float(self._max_value[1:]) <= value: return False elif to_float(self._max_value) < value: return False return True
def _validate_zset_score(score): clean_score = score.strip('(').lower().replace('nan', 'invalid') try: to_float(clean_score) except ValueError: raise DredisSyntaxError("min or max is not a float")
def above_max(self, value): max_value = self._max_value[1:] if self._max_value.startswith( '(') else self._max_value return value > to_float(max_value)