redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

mypy thinks sadd is not awaitable

Open gergelypolonkai opened this issue 1 year ago • 2 comments

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.

gergelypolonkai avatar Mar 28 '24 07:03 gergelypolonkai

sismember also got the same problem.

haok1402 avatar Mar 31 '24 01:03 haok1402

duplicated issue #2399

mattwang44 avatar Apr 26 '24 03:04 mattwang44