46
46
from .helpers import list_or_args
47
47
48
48
if TYPE_CHECKING :
49
- from redis .asyncio .client import Redis as AsyncRedis
50
- from redis .client import Redis
49
+ import redis .asyncio .client
50
+ import redis .client
51
51
52
52
53
53
class ACLCommands (CommandsProtocol ):
@@ -1442,7 +1442,7 @@ class BitFieldOperation:
1442
1442
1443
1443
def __init__ (
1444
1444
self ,
1445
- client : Union ["Redis" , "AsyncRedis " ],
1445
+ client : Union ["redis.client. Redis" , "redis.asyncio.client.Redis " ],
1446
1446
key : str ,
1447
1447
default_overflow : Union [str , None ] = None ,
1448
1448
):
@@ -1586,7 +1586,7 @@ def bitcount(
1586
1586
return self .execute_command ("BITCOUNT" , * params , keys = [key ])
1587
1587
1588
1588
def bitfield (
1589
- self : Union ["Redis" , "AsyncRedis " ],
1589
+ self : Union ["redis.client. Redis" , "redis.asyncio.client.Redis " ],
1590
1590
key : KeyT ,
1591
1591
default_overflow : Union [str , None ] = None ,
1592
1592
) -> BitFieldOperation :
@@ -1599,7 +1599,7 @@ def bitfield(
1599
1599
return BitFieldOperation (self , key , default_overflow = default_overflow )
1600
1600
1601
1601
def bitfield_ro (
1602
- self : Union ["Redis" , "AsyncRedis " ],
1602
+ self : Union ["redis.client. Redis" , "redis.asyncio.client.Redis " ],
1603
1603
key : KeyT ,
1604
1604
encoding : str ,
1605
1605
offset : BitfieldOffsetT ,
@@ -5467,7 +5467,7 @@ class Script:
5467
5467
An executable Lua script object returned by ``register_script``
5468
5468
"""
5469
5469
5470
- def __init__ (self , registered_client : "Redis" , script : ScriptTextT ):
5470
+ def __init__ (self , registered_client : "redis.client. Redis" , script : ScriptTextT ):
5471
5471
self .registered_client = registered_client
5472
5472
self .script = script
5473
5473
# Precalculate and store the SHA1 hex digest of the script.
@@ -5487,7 +5487,7 @@ def __call__(
5487
5487
self ,
5488
5488
keys : Union [Sequence [KeyT ], None ] = None ,
5489
5489
args : Union [Iterable [EncodableT ], None ] = None ,
5490
- client : Union ["Redis" , None ] = None ,
5490
+ client : Union ["redis.client. Redis" , None ] = None ,
5491
5491
):
5492
5492
"""Execute the script, passing any required ``args``"""
5493
5493
keys = keys or []
@@ -5516,7 +5516,11 @@ class AsyncScript:
5516
5516
An executable Lua script object returned by ``register_script``
5517
5517
"""
5518
5518
5519
- def __init__ (self , registered_client : "AsyncRedis" , script : ScriptTextT ):
5519
+ def __init__ (
5520
+ self ,
5521
+ registered_client : "redis.asyncio.client.Redis" ,
5522
+ script : ScriptTextT ,
5523
+ ):
5520
5524
self .registered_client = registered_client
5521
5525
self .script = script
5522
5526
# Precalculate and store the SHA1 hex digest of the script.
@@ -5536,7 +5540,7 @@ async def __call__(
5536
5540
self ,
5537
5541
keys : Union [Sequence [KeyT ], None ] = None ,
5538
5542
args : Union [Iterable [EncodableT ], None ] = None ,
5539
- client : Union ["AsyncRedis " , None ] = None ,
5543
+ client : Union ["redis.asyncio.client.Redis " , None ] = None ,
5540
5544
):
5541
5545
"""Execute the script, passing any required ``args``"""
5542
5546
keys = keys or []
@@ -5761,7 +5765,7 @@ def script_load(self, script: ScriptTextT) -> ResponseT:
5761
5765
"""
5762
5766
return self .execute_command ("SCRIPT LOAD" , script )
5763
5767
5764
- def register_script (self : "Redis" , script : ScriptTextT ) -> Script :
5768
+ def register_script (self : "redis.client. Redis" , script : ScriptTextT ) -> Script :
5765
5769
"""
5766
5770
Register a Lua ``script`` specifying the ``keys`` it will touch.
5767
5771
Returns a Script object that is callable and hides the complexity of
@@ -5775,7 +5779,10 @@ class AsyncScriptCommands(ScriptCommands):
5775
5779
async def script_debug (self , * args ) -> None :
5776
5780
return super ().script_debug ()
5777
5781
5778
- def register_script (self : "AsyncRedis" , script : ScriptTextT ) -> AsyncScript :
5782
+ def register_script (
5783
+ self : "redis.asyncio.client.Redis" ,
5784
+ script : ScriptTextT ,
5785
+ ) -> AsyncScript :
5779
5786
"""
5780
5787
Register a Lua ``script`` specifying the ``keys`` it will touch.
5781
5788
Returns a Script object that is callable and hides the complexity of
0 commit comments