Skip to content

Commit 26b9021

Browse files
Improve type hints of from_url method for async Redis client. (#3796)
* Add return type annotations to from_url methods - Add return type annotation to Redis.from_url() in client.py - Add parameter and return type annotations to utils.from_url() - Improves type safety and IDE autocomplete support - Resolves MyPy no-untyped-call errors for users * Reorder import statements in utils.py --------- Co-authored-by: cheizdo2-art <cheizdo2-art@users.noreply.github.com> Co-authored-by: petyaslavova <petya.slavova@redis.com>
1 parent ce59a2c commit 26b9021

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redis/asyncio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class Redis(
126126

127127
@classmethod
128128
def from_url(
129-
cls,
129+
cls: Type["Redis"],
130130
url: str,
131131
single_connection_client: bool = False,
132132
auto_close_connection_pool: Optional[bool] = None,

0 commit comments

Comments
 (0)