MCPcopy
hub / github.com/redis/redis-py / decode_list

Function decode_list

redis/commands/json/decoders.py:49–60  ·  view source on GitHub ↗

Given a non-deserializable object, make a best effort to return a useful set of results.

(b)

Source from the content-addressed store, hash-verified

47
48
49def decode_list(b):
50 """
51 Given a non-deserializable object, make a best effort to
52 return a useful set of results.
53 """
54 if isinstance(b, list):
55 return [nativestr(obj) for obj in b]
56 elif isinstance(b, bytes):
57 return unstring(nativestr(b))
58 elif isinstance(b, str):
59 return unstring(b)
60 return b

Callers 2

_decodeMethod · 0.85

Calls 2

nativestrFunction · 0.85
unstringFunction · 0.85

Tested by 1