summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Yin <raymond@tryevergreen.com>2023-03-15 03:27:42 -0700
committerGitHub <noreply@github.com>2023-03-15 12:27:42 +0200
commita372ba4f28f874ebff008a3bb4f5ce06104fd29b (patch)
tree155f02e8fce8f5edaa37253528933e23a8e7c7fe
parent6d1061f50a6fe4cfa0a39f6a6852ed1a3a6da0bd (diff)
downloadredis-py-a372ba4f28f874ebff008a3bb4f5ce06104fd29b.tar.gz
[types] update return type of smismember to list[int] (#2617)
* update return type of smismember * use Literal instead of int
-rw-r--r--redis/commands/core.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py
index 28dab81..e2cabb8 100644
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -3357,10 +3357,15 @@ class SetCommands(CommandsProtocol):
def smismember(
self, name: str, values: List, *args: List
- ) -> Union[Awaitable[List[bool]], List[bool]]:
+ ) -> Union[
+ Awaitable[List[Union[Literal[0], Literal[1]]]],
+ List[Union[Literal[0], Literal[1]]],
+ ]:
"""
Return whether each value in ``values`` is a member of the set ``name``
- as a list of ``bool`` in the order of ``values``
+ as a list of ``int`` in the order of ``values``:
+ - 1 if the value is a member of the set.
+ - 0 if the value is not a member of the set or if key does not exist.
For more information see https://redis.io/commands/smismember
"""