Skip to content

Commit a372ba4

Browse files
authored
[types] update return type of smismember to list[int] (#2617)
* update return type of smismember * use Literal instead of int
1 parent 6d1061f commit a372ba4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

redis/commands/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,10 +3357,15 @@ def smembers(self, name: str) -> Union[Awaitable[Set], Set]:
33573357

33583358
def smismember(
33593359
self, name: str, values: List, *args: List
3360-
) -> Union[Awaitable[List[bool]], List[bool]]:
3360+
) -> Union[
3361+
Awaitable[List[Union[Literal[0], Literal[1]]]],
3362+
List[Union[Literal[0], Literal[1]]],
3363+
]:
33613364
"""
33623365
Return whether each value in ``values`` is a member of the set ``name``
3363-
as a list of ``bool`` in the order of ``values``
3366+
as a list of ``int`` in the order of ``values``:
3367+
- 1 if the value is a member of the set.
3368+
- 0 if the value is not a member of the set or if key does not exist.
33643369
33653370
For more information see https://redis.io/commands/smismember
33663371
"""

0 commit comments

Comments
 (0)