Skip to content

fix: changed list type to single element type #2203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2593,15 +2593,15 @@ def lpop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]
else:
return self.execute_command("LPOP", name)

def lpush(self, name: str, *values: List) -> Union[Awaitable[int], int]:
def lpush(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]:
"""
Push ``values`` onto the head of the list ``name``

For more information see https://redis.io/commands/lpush
"""
return self.execute_command("LPUSH", name, *values)

def lpushx(self, name: str, *values: List) -> Union[Awaitable[int], int]:
def lpushx(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]:
"""
Push ``value`` onto the head of the list ``name`` if ``name`` exists

Expand Down Expand Up @@ -2679,7 +2679,7 @@ def rpoplpush(self, src: str, dst: str) -> Union[Awaitable[str], str]:
"""
return self.execute_command("RPOPLPUSH", src, dst)

def rpush(self, name: str, *values: List) -> Union[Awaitable[int], int]:
def rpush(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]:
"""
Push ``values`` onto the tail of the list ``name``

Expand Down Expand Up @@ -3169,7 +3169,7 @@ class SetCommands(CommandsProtocol):
see: https://redis.io/topics/data-types#sets
"""

def sadd(self, name: str, *values: List) -> Union[Awaitable[int], int]:
def sadd(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]:
"""
Add ``value(s)`` to set ``name``

Expand Down Expand Up @@ -3307,7 +3307,7 @@ def srandmember(
args = (number is not None) and [number] or []
return self.execute_command("SRANDMEMBER", name, *args)

def srem(self, name: str, *values: List) -> Union[Awaitable[int], int]:
def srem(self, name: str, *values: FieldT) -> Union[Awaitable[int], int]:
"""
Remove ``values`` from set ``name``

Expand Down Expand Up @@ -4586,7 +4586,7 @@ def zrank(self, name: KeyT, value: EncodableT) -> ResponseT:
"""
return self.execute_command("ZRANK", name, value)

def zrem(self, name: KeyT, *values: EncodableT) -> ResponseT:
def zrem(self, name: KeyT, *values: FieldT) -> ResponseT:
"""
Remove member ``values`` from sorted set ``name``

Expand Down Expand Up @@ -4735,7 +4735,7 @@ class HyperlogCommands(CommandsProtocol):
see: https://redis.io/topics/data-types-intro#hyperloglogs
"""

def pfadd(self, name: KeyT, *values: EncodableT) -> ResponseT:
def pfadd(self, name: KeyT, *values: FieldT) -> ResponseT:
"""
Adds the specified elements to the specified HyperLogLog.

Expand Down