Skip to content

Probably wrong type hint for evalsha function #3455

@artsiomkaltovich

Description

@artsiomkaltovich

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions