diff --git a/redis/cluster.py b/redis/cluster.py index 56c354b814..f915c71eb2 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -4,7 +4,7 @@ import threading import time from collections import OrderedDict -from typing import Any, Callable, Dict, List, Optional, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, TypeVar from redis.backoff import default_backoff from redis.client import CaseInsensitiveDict, PubSub, Redis, parse_scan @@ -38,6 +38,10 @@ str_if_bytes, ) +TargetNodesT = TypeVar( + "TargetNodesT", str, "ClusterNode", List["ClusterNode"], Dict[Any, "ClusterNode"] +) + def get_node_name(host: str, port: Union[str, int]) -> str: return f"{host}:{port}"