Skip to content

Commit

Permalink
Added ClusterNode type
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Nov 20, 2022
1 parent b69fa00 commit f887618
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit f887618

Please sign in to comment.