redis-py
redis-py copied to clipboard
mypy thinks sadd is not awaitable
Version: 5.0.3
Platform: Python 3.12 on Fedora 39, using Redis 7.2.4
Description: When linting the following line with MyPy, it reports an incompatible type.
from redis.asyncio import from_url
r = from_url("redis://localhost")
await r.sadd("key", "value")
test.py:5: error: Incompatible types in "await" (actual type "Awaitable[int] | int", expected type "Awaitable[Any]") [misc]
Using set, get, incrby, etc. doesn’t trigger this error.
sismember also got the same problem.
duplicated issue #2399