@@ -3947,7 +3947,12 @@ def eval_ro(self, script: str, numkeys: int, *keys_and_args: list) -> str:
3947
3947
"""
3948
3948
return self ._eval ("EVAL_RO" , script , numkeys , * keys_and_args )
3949
3949
3950
- def evalsha (self , sha , numkeys , * keys_and_args ):
3950
+ def _evalsha (
3951
+ self , command : str , sha : str , numkeys : int , * keys_and_args : list
3952
+ ) -> str :
3953
+ return self .execute_command (command , sha , numkeys , * keys_and_args )
3954
+
3955
+ def evalsha (self , sha : str , numkeys : int , * keys_and_args : list ) -> str :
3951
3956
"""
3952
3957
Use the ``sha`` to execute a Lua script already registered via EVAL
3953
3958
or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the
@@ -3959,7 +3964,20 @@ def evalsha(self, sha, numkeys, *keys_and_args):
3959
3964
3960
3965
For more information check https://redis.io/commands/evalsha
3961
3966
"""
3962
- return self .execute_command ("EVALSHA" , sha , numkeys , * keys_and_args )
3967
+ return self ._evalsha ("EVALSHA" , sha , numkeys , * keys_and_args )
3968
+
3969
+ def evalsha_ro (self , sha : str , numkeys : int , * keys_and_args : list ) -> str :
3970
+ """
3971
+ The read-only variant of the EVALSHA command
3972
+
3973
+ Use the ``sha`` to execute a read-only Lua script already registered via EVAL
3974
+ or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the
3975
+ key names and argument values in ``keys_and_args``. Returns the result
3976
+ of the script.
3977
+
3978
+ For more information check https://redis.io/commands/evalsha_ro
3979
+ """
3980
+ return self ._evalsha ("EVALSHA_RO" , sha , numkeys , * keys_and_args )
3963
3981
3964
3982
def script_exists (self , * args ):
3965
3983
"""
0 commit comments