Skip to content

Commit 1c474e5

Browse files
authored
Fixing argument type hints for evalsha and similar commands. (#3794)
1 parent d0e92c6 commit 1c474e5

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

redis/commands/core.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5861,12 +5861,16 @@ class ScriptCommands(CommandsProtocol):
58615861
"""
58625862

58635863
def _eval(
5864-
self, command: str, script: str, numkeys: int, *keys_and_args: str
5864+
self,
5865+
command: str,
5866+
script: str,
5867+
numkeys: int,
5868+
*keys_and_args: Union[KeyT, EncodableT],
58655869
) -> Union[Awaitable[str], str]:
58665870
return self.execute_command(command, script, numkeys, *keys_and_args)
58675871

58685872
def eval(
5869-
self, script: str, numkeys: int, *keys_and_args: str
5873+
self, script: str, numkeys: int, *keys_and_args: Union[KeyT, EncodableT]
58705874
) -> Union[Awaitable[str], str]:
58715875
"""
58725876
Execute the Lua ``script``, specifying the ``numkeys`` the script
@@ -5881,7 +5885,7 @@ def eval(
58815885
return self._eval("EVAL", script, numkeys, *keys_and_args)
58825886

58835887
def eval_ro(
5884-
self, script: str, numkeys: int, *keys_and_args: str
5888+
self, script: str, numkeys: int, *keys_and_args: Union[KeyT, EncodableT]
58855889
) -> Union[Awaitable[str], str]:
58865890
"""
58875891
The read-only variant of the EVAL command
@@ -5895,12 +5899,16 @@ def eval_ro(
58955899
return self._eval("EVAL_RO", script, numkeys, *keys_and_args)
58965900

58975901
def _evalsha(
5898-
self, command: str, sha: str, numkeys: int, *keys_and_args: list
5902+
self,
5903+
command: str,
5904+
sha: str,
5905+
numkeys: int,
5906+
*keys_and_args: Union[KeyT, EncodableT],
58995907
) -> Union[Awaitable[str], str]:
59005908
return self.execute_command(command, sha, numkeys, *keys_and_args)
59015909

59025910
def evalsha(
5903-
self, sha: str, numkeys: int, *keys_and_args: str
5911+
self, sha: str, numkeys: int, *keys_and_args: Union[KeyT, EncodableT]
59045912
) -> Union[Awaitable[str], str]:
59055913
"""
59065914
Use the ``sha`` to execute a Lua script already registered via EVAL
@@ -5916,7 +5924,7 @@ def evalsha(
59165924
return self._evalsha("EVALSHA", sha, numkeys, *keys_and_args)
59175925

59185926
def evalsha_ro(
5919-
self, sha: str, numkeys: int, *keys_and_args: str
5927+
self, sha: str, numkeys: int, *keys_and_args: Union[KeyT, EncodableT]
59205928
) -> Union[Awaitable[str], str]:
59215929
"""
59225930
The read-only variant of the EVALSHA command

0 commit comments

Comments
 (0)