@classmethod<EOL><INDENT>def encode(cls, value):<DEDENT>
try:<EOL><INDENT>coerced = list(value)<EOL>if coerced == value:<EOL><INDENT>return json.dumps(coerced).encode(cls._encoding)<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>raise InvalidValue('<STR_LIT>')<EOL>
take a list and turn it into a utf-8 encoded byte-string for redis.

:param value: list
:return: bytes