Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def sort_key(v):
byval = self._lookup_key(v, sortby)
# TODO: use locale.strxfrm when not storing? But then need
# to decode too.
if byval is None:
byval = BeforeAny()
return byval
def __eq__(self, other):
return isinstance(other, 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)