Repository: aio-libs-abandoned/aioredis-py

Issue:
Restrictive typing on evalsha keys_and_args argument
### Describe the bug

The Redis `eval` method uses `*keys_and_args: EncodableT` to type variable arguments, but the `evalsha` method uses `*keys_and_args: str`. It should allow all the encodable types as arguments.

### To Reproduce

In aioredis 2.0.0:

```python
await redis.evalsha(sha, num_keys, b'foo', 'bar')
```

Run `mypy` and observe the following error:

```
Argument 3 to "evalsha" of "Redis" has incompatible type "bytes"; expected "str"
```

### Expected behavior

In an `evalsha` call, the 3rd argument and beyond should allow any encodable type without causing typing errors in `mypy`.

### Logs/tracebacks

```python-traceback
Argument 3 to "evalsha" of "Redis" has incompatible type "bytes"; expected "str"
```
```


### Python Version

```console
$ python --version
Python 3.10.0

$ mypy --version
mypy 0.910
```


### aioredis Version

```console
$ python -m pip show aioredis
Name: aioredis
Version: 2.0.0
Summary: asyncio (PEP 3156) Redis support
Home-page: https://github.com/aio-libs/aioredis
Author:
Author-email:
License: MIT
Location: /Users/ian/dev/pymap/.venv/lib/python3.10/site-packages
Requires: async-timeout, typing-extensions
Required-by:
```


### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct
Restrictive typing on evalsha keys_and_args argument
### Describe the bug

The Redis `eval` method uses `*keys_and_args: EncodableT` to type variable arguments, but the `evalsha` method uses `*keys_and_args: str`. It should allow all the encodable types as arguments.

### To Reproduce

In aioredis 2.0.0:

```python
await redis.evalsha(sha, num_keys, b'foo', 'bar')
```

Run `mypy` and observe the following error:

```
Argument 3 to "evalsha" of "Redis" has incompatible type "bytes"; expected "str"
```

### Expected behavior

In an `evalsha` call, the 3rd argument and beyond should allow any encodable type without causing typing errors in `mypy`.

### Logs/tracebacks

```python-traceback
Argument 3 to "evalsha" of "Redis" has incompatible type "bytes"; expected "str"
```
```


### Python Version

```console
$ python --version
Python 3.10.0

$ mypy --version
mypy 0.910
```


### aioredis Version

```console
$ python -m pip show aioredis
Name: aioredis
Version: 2.0.0
Summary: asyncio (PEP 3156) Redis support
Home-page: https://github.com/aio-libs/aioredis
Author:
Author-email:
License: MIT
Location: /Users/ian/dev/pymap/.venv/lib/python3.10/site-packages
Requires: async-timeout, typing-extensions
Required-by:
```


### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:

Resolving patch:
diff --git a/aioredis/client.py b/aioredis/client.py
--- a/aioredis/client.py
+++ b/aioredis/client.py
@@ -3576,7 +3576,7 @@ def eval(
         """
         return self.execute_command("EVAL", script, numkeys, *keys_and_args)
 
-    def evalsha(self, sha: str, numkeys: int, *keys_and_args: str) -> Awaitable:
+    def evalsha(self, sha: str, numkeys: int, *keys_and_args: EncodableT) -> Awaitable:
         """
         Use the ``sha`` to execute a Lua script already registered via EVAL
         or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the


Test patch: