-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
After moving to use redis v6 from v5, mypy began complaining that redis.Redis() was returning type Any. I investigated and pinned down that up through v6.0.0b2, it correctly knew the return type was redis.client.Redis, and starting in v6.0.0, it was Any.
Running mypy on the following script shows the issue:
from typing import reveal_type
import redis
reveal_type(redis.Redis(host="harf", port=100, db=0))I noticed that the @deprecated_args decorator was added to the redis.client.Redis.__init__() method with this commit that fell in the gap between those two versions. I verified that removing that decorator solved the problem. I then looked at the definition of that decorator, and I can see why it is losing the type information. I have tested a fix for this, and will be opening a PR for consideration.
Metadata
Metadata
Assignees
Labels
No labels