Skip to content
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

Probably wrong type hint for evalsha function #3455

Open
artsiomkaltovich opened this issue Dec 12, 2024 · 1 comment
Open

Probably wrong type hint for evalsha function #3455

artsiomkaltovich opened this issue Dec 12, 2024 · 1 comment

Comments

@artsiomkaltovich
Copy link

https://github.com/redis/redis-py/blob/master/redis/commands/core.py#L5697

The last arg is declared as *keys_and_args: str, but it calls https://github.com/redis/redis-py/blob/master/redis/commands/core.py#L5692 and there it is declared as list.

    def _evalsha(
        self, command: str, sha: str, numkeys: int, *keys_and_args: list
    ) -> Union[Awaitable[str], str]:
        return self.execute_command(command, sha, numkeys, *keys_and_args)

    def evalsha(
        self, sha: str, numkeys: int, *keys_and_args: str
    ) -> Union[Awaitable[str], str]:
        """
        Use the ``sha`` to execute a Lua script already registered via EVAL
        or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the
        key names and argument values in ``keys_and_args``. Returns the result
        of the script.

        In practice, use the object returned by ``register_script``. This
        function exists purely for Redis API completion.

        For more information see  https://redis.io/commands/evalsha
        """
        return self._evalsha("EVALSHA", sha, numkeys, *keys_and_args)
@artsiomkaltovich
Copy link
Author

Could you additionally kindly submit or link an example demonstrating how to use the object returned by register_script?
Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant