Skip to content
Open
Show file tree
Hide file tree
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
24 changes: 11 additions & 13 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def command_list(

return self.execute_command("COMMAND LIST", *pieces)

def command_getkeysandflags(self, *args: List[str]) -> List[Union[str, List[str]]]:
def command_getkeysandflags(self, *args: str) -> List[Union[str, List[str]]]:
"""
Returns array of keys from a full Redis command and their usage flags.

Expand All @@ -848,7 +848,7 @@ def command_docs(self, *args):
)

def config_get(
self, pattern: PatternT = "*", *args: List[PatternT], **kwargs
self, pattern: PatternT = "*", *args: PatternT, **kwargs
) -> ResponseT:
"""
Return a dictionary of configuration based on the ``pattern``
Expand All @@ -861,7 +861,7 @@ def config_set(
self,
name: KeyT,
value: EncodableT,
*args: List[Union[KeyT, EncodableT]],
*args: Union[KeyT, EncodableT],
**kwargs,
) -> ResponseT:
"""Set config item ``name`` with ``value``
Expand Down Expand Up @@ -987,9 +987,7 @@ def select(self, index: int, **kwargs) -> ResponseT:
"""
return self.execute_command("SELECT", index, **kwargs)

def info(
self, section: Optional[str] = None, *args: List[str], **kwargs
) -> ResponseT:
def info(self, section: Optional[str] = None, *args: str, **kwargs) -> ResponseT:
"""
Returns a dictionary containing information about the Redis server

Expand Down Expand Up @@ -2606,7 +2604,7 @@ def blmpop(
self,
timeout: float,
numkeys: int,
*args: List[str],
*args: str,
direction: str,
count: Optional[int] = 1,
) -> Optional[list]:
Expand All @@ -2619,14 +2617,14 @@ def blmpop(

For more information, see https://redis.io/commands/blmpop
"""
args = [timeout, numkeys, *args, direction, "COUNT", count]
cmd_args = [timeout, numkeys, *args, direction, "COUNT", count]

return self.execute_command("BLMPOP", *args)
return self.execute_command("BLMPOP", *cmd_args)

def lmpop(
self,
num_keys: int,
*args: List[str],
*args: str,
direction: str,
count: Optional[int] = 1,
) -> Union[Awaitable[list], list]:
Expand All @@ -2636,11 +2634,11 @@ def lmpop(

For more information, see https://redis.io/commands/lmpop
"""
args = [num_keys] + list(args) + [direction]
cmd_args = [num_keys] + list(args) + [direction]
if count != 1:
args.extend(["COUNT", count])
cmd_args.extend(["COUNT", count])

return self.execute_command("LMPOP", *args)
return self.execute_command("LMPOP", *cmd_args)

def lindex(
self, name: str, index: int
Expand Down
4 changes: 2 additions & 2 deletions redis/commands/json/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JSONCommands:
"""json commands."""

def arrappend(
self, name: str, path: Optional[str] = Path.root_path(), *args: List[JsonType]
self, name: str, path: Optional[str] = Path.root_path(), *args: JsonType
) -> List[Optional[int]]:
"""Append the objects ``args`` to the array under the
``path` in key ``name``.
Expand Down Expand Up @@ -52,7 +52,7 @@ def arrindex(
return self.execute_command("JSON.ARRINDEX", *pieces, keys=[name])

def arrinsert(
self, name: str, path: str, index: int, *args: List[JsonType]
self, name: str, path: str, index: int, *args: JsonType
) -> List[Optional[int]]:
"""Insert the objects ``args`` to the array at index ``index``
under the ``path` in key ``name``.
Expand Down