You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
For some reasons, mypy shows the incompatible types error for the expiretime command in the async case, but this code works fine. What could be the problem?
importasynciofromredis.asyncioimportConnectionPool, Redisasyncdefmain() ->None:
pool=ConnectionPool.from_url('redis://localhost:6379/0')
client=awaitRedis.from_pool(connection_pool=pool)
assertisinstance(client, Redis)
try:
awaitclient.set('key', 'value', ex=300)
exp=awaitclient.expiretime('key') # error: Incompatible types in "await" (actual type "int", expected type "Awaitable[Any]") [misc]assertisinstance(exp, int)
finally:
awaitclient.aclose()
if__name__=='__main__':
asyncio.run(main())
According to this description: "Redis-py 5.0.0 added a py.typed file, but the inline annotations are incomplete", so perhaps the issue is the built-in annotations
P.S. looks similar to 2399
The text was updated successfully, but these errors were encountered:
Version:
redis==5.0.4, mypy==1.10.0
Platform:
Python 3.12 on Ubuntu 23.10
Description:
For some reasons,
mypy
shows the incompatible types error for theexpiretime
command in the async case, but this code works fine. What could be the problem?According to this description: "Redis-py 5.0.0 added a py.typed file, but the inline annotations are incomplete", so perhaps the issue is the built-in annotations
P.S. looks similar to 2399
The text was updated successfully, but these errors were encountered: