@@ -8,7 +8,7 @@ from typing_extensions import Literal
8
8
from redis .client import CaseInsensitiveDict , PubSub , Redis , _ParseResponseOptions
9
9
from redis .commands import CommandsParser , RedisClusterCommands
10
10
from redis .commands .core import _StrType
11
- from redis .connection import BaseParser , Connection , ConnectionPool , Encoder , _ConnectionPoolOptions
11
+ from redis .connection import BaseParser , Connection , ConnectionPool , Encoder , _ConnectionPoolOptions , _Encodable
12
12
from redis .exceptions import MovedError , RedisError
13
13
from redis .typing import EncodableT
14
14
@@ -86,8 +86,7 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic
86
86
def get_replicas (self ) -> list [ClusterNode ]: ...
87
87
def get_random_node (self ) -> ClusterNode : ...
88
88
def get_nodes (self ) -> list [ClusterNode ]: ...
89
- # TODO: use type alias for `str | bytes | memoryview | bool | float`
90
- def get_node_from_key (self , key : str | bytes | memoryview | bool | float , replica : bool = ...) -> ClusterNode | None : ...
89
+ def get_node_from_key (self , key : _Encodable , replica : bool = ...) -> ClusterNode | None : ...
91
90
def get_default_node (self ) -> ClusterNode | None : ...
92
91
def set_default_node (self , node : ClusterNode | None ) -> bool : ...
93
92
def monitor (self , target_node : Any | None = ...): ...
@@ -103,7 +102,7 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic
103
102
lock_class : type [Incomplete ] | None = ...,
104
103
thread_local : bool = ...,
105
104
): ...
106
- def keyslot (self , key : str | bytes | memoryview | bool | float ) -> int : ...
105
+ def keyslot (self , key : _Encodable ) -> int : ...
107
106
def determine_slot (self , * args ): ...
108
107
def get_encoder (self ) -> Encoder : ...
109
108
def get_connection_kwargs (self ) -> dict [str , Any ]: ...
0 commit comments