Skip to content

Commit bc6dbd8

Browse files
authored
change sismember return type (#2813)
1 parent 8aba380 commit bc6dbd8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

redis/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ class AbstractRedis:
820820
# **string_keys_to_dict(
821821
# "COPY "
822822
# "HEXISTS HMSET MOVE MSETNX PERSIST "
823-
# "PSETEX RENAMENX SISMEMBER SMOVE SETEX SETNX",
823+
# "PSETEX RENAMENX SMOVE SETEX SETNX",
824824
# bool,
825825
# ),
826826
# **string_keys_to_dict(

redis/commands/core.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -3339,9 +3339,13 @@ def sinterstore(
33393339
args = list_or_args(keys, args)
33403340
return self.execute_command("SINTERSTORE", dest, *args)
33413341

3342-
def sismember(self, name: str, value: str) -> Union[Awaitable[bool], bool]:
3342+
def sismember(
3343+
self, name: str, value: str
3344+
) -> Union[Awaitable[Union[Literal[0], Literal[1]]], Union[Literal[0], Literal[1]]]:
33433345
"""
3344-
Return a boolean indicating if ``value`` is a member of set ``name``
3346+
Return whether ``value`` is a member of set ``name``:
3347+
- 1 if the value is a member of the set.
3348+
- 0 if the value is not a member of the set or if key does not exist.
33453349
33463350
For more information see https://redis.io/commands/sismember
33473351
"""

0 commit comments

Comments
 (0)