Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from itertools import chain
from queue import Empty, Full, LifoQueue
from time import time
from typing import Any, Callable, Dict, List, Optional, Type, Union
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union
from urllib.parse import parse_qs, unquote, urlparse

from redis.cache import (
Expand Down Expand Up @@ -1263,6 +1263,9 @@ def parse_url(url):
return kwargs


_CP = TypeVar("_CP", bound="ConnectionPool")


class ConnectionPool:
"""
Create a connection pool. ``If max_connections`` is set, then this
Expand All @@ -1278,7 +1281,7 @@ class ConnectionPool:
"""

@classmethod
def from_url(cls, url, **kwargs):
def from_url(cls: Type[_CP], url: str, **kwargs) -> _CP:
"""
Return a connection pool configured from the given URL.

Expand Down
Loading