Skip to content

Commit f887618

Browse files
committed
Added ClusterNode type
1 parent b69fa00 commit f887618

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

redis/cluster.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import threading
55
import time
66
from collections import OrderedDict
7-
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
7+
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, TypeVar
88

99
from redis.backoff import default_backoff
1010
from redis.client import CaseInsensitiveDict, PubSub, Redis, parse_scan
@@ -38,6 +38,10 @@
3838
str_if_bytes,
3939
)
4040

41+
TargetNodesT = TypeVar(
42+
"TargetNodesT", str, "ClusterNode", List["ClusterNode"], Dict[Any, "ClusterNode"]
43+
)
44+
4145

4246
def get_node_name(host: str, port: Union[str, int]) -> str:
4347
return f"{host}:{port}"

0 commit comments

Comments
 (0)