Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Restrictive typing on evalsha keys_and_args argument #1214

Closed
1 task done
icgood opened this issue Nov 21, 2021 · 0 comments · Fixed by #1215
Closed
1 task done

Restrictive typing on evalsha keys_and_args argument #1214

icgood opened this issue Nov 21, 2021 · 0 comments · Fixed by #1215
Labels

Comments

@icgood
Copy link
Contributor

icgood commented Nov 21, 2021

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:

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

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

$ 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

  • I agree to follow the aio-libs Code of Conduct
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant