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

Function list_or_args

redis/commands/helpers.py:18–32  ·  view source on GitHub ↗
(keys: Any, args: Iterable[Any] | None)

Source from the content-addressed store, hash-verified

16
17
18def list_or_args(keys: Any, args: Iterable[Any] | None) -> List[Any]:
19 # returns a single new list combining keys and args
20 try:
21 iter(keys)
22 # a string or bytes-like instance can be iterated, but indicates
23 # keys wasn't passed as a list
24 if isinstance(keys, (bytes, str, bytearray, memoryview)):
25 keys = [keys]
26 else:
27 keys = list(keys)
28 except TypeError:
29 keys = [keys]
30 if args:
31 keys.extend(args)
32 return keys
33
34
35def parse_pubsub_subscriptions(

Callers 15

test_list_or_argsFunction · 0.90
punsubscribeMethod · 0.90
unsubscribeMethod · 0.90
sunsubscribeMethod · 0.90
sunsubscribeMethod · 0.90
punsubscribeMethod · 0.90
unsubscribeMethod · 0.90
sunsubscribeMethod · 0.90
sunsubscribeMethod · 0.90
acl_setuserMethod · 0.85
migrateMethod · 0.85
mgetMethod · 0.85

Calls 1

extendMethod · 0.45

Tested by 1

test_list_or_argsFunction · 0.72