1
1
import builtins
2
- from collections .abc import Iterable
2
+ from collections .abc import Sequence
3
3
import random
4
4
import socket
5
5
from typing import (
34
34
class BaseClient :
35
35
def __init__ (
36
36
self ,
37
- server : str | Iterable ,
37
+ server : Sequence ,
38
38
params : dict [str , Any ],
39
39
backend : "ValkeyCache" ,
40
40
) -> None :
@@ -44,7 +44,7 @@ def __init__(
44
44
error_message = "Missing connections string"
45
45
raise ImproperlyConfigured (error_message )
46
46
if not isinstance (self ._server , (list , tuple , set )):
47
- self ._server = self ._server .split ("," )
47
+ self ._server = self ._server .split ("," ) # type: ignore[attr-defined]
48
48
49
49
self ._params = params
50
50
@@ -75,14 +75,14 @@ def __init__(
75
75
)
76
76
77
77
self ._connection_factory = getattr (
78
- settings , "DJANGO_VALKEY_CONNECTION_FACTORY" , self .CONNECTION_FACTORY_PATH
78
+ settings , "DJANGO_VALKEY_CONNECTION_FACTORY" , self .CONNECTION_FACTORY_PATH # type: ignore[attr-defined]
79
79
)
80
80
self .connection_factory = pool .get_connection_factory (
81
81
options = self ._options , path = self ._connection_factory
82
82
)
83
83
84
84
def __contains__ (self , key : KeyT ) -> bool :
85
- return self .has_key (key )
85
+ return self .has_key (key ) # type: ignore[attr-defined]
86
86
87
87
def _has_compression_enabled (self ) -> bool :
88
88
return (
0 commit comments