Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def upper_bound(self):
return (self.value, BeforeAny() if self.exclusive else AfterAny())
def lower_bound(self):
return (self.value, AfterAny() if self.exclusive else BeforeAny())
def decode(cls, value):
if value == b'-':
return cls(BeforeAny(), True)
elif value == b'+':
return cls(AfterAny(), True)
elif value[:1] == b'(':
return cls(value[1:], True)
elif value[:1] == b'[':
return cls(value[1:], False)
else:
raise redis.ResponseError(INVALID_MIN_MAX_STR_MSG)
def __eq__(self, other):
return isinstance(other, AfterAny)