mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
redis: Add some type hints (#3055)
This commit is contained in:
committed by
Sebastian Rittau
parent
01c2fa5a14
commit
38f253ed69
12
third_party/2and3/redis/client.pyi
vendored
12
third_party/2and3/redis/client.pyi
vendored
@@ -1,5 +1,5 @@
|
||||
from datetime import timedelta
|
||||
from typing import Any, Text, Optional, Mapping, Union
|
||||
from typing import Any, Iterable, Text, Optional, Mapping, Tuple, Union
|
||||
|
||||
from .connection import ConnectionPool
|
||||
|
||||
@@ -34,6 +34,8 @@ def parse_hscan(response, **options): ...
|
||||
def parse_zscan(response, **options): ...
|
||||
def parse_slowlog_get(response, **options): ...
|
||||
|
||||
_Str = Union[bytes, float, Text]
|
||||
|
||||
class Redis(object):
|
||||
RESPONSE_CALLBACKS: Any
|
||||
@classmethod
|
||||
@@ -161,14 +163,14 @@ class Redis(object):
|
||||
def type(self, name): ...
|
||||
def watch(self, *names): ...
|
||||
def unwatch(self): ...
|
||||
def blpop(self, keys, timeout=...): ...
|
||||
def brpop(self, keys, timeout=...): ...
|
||||
def blpop(self, keys: Union[_Str, Iterable[_Str]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ...
|
||||
def brpop(self, keys: Union[_Str, Iterable[_Str]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ...
|
||||
def brpoplpush(self, src, dst, timeout=...): ...
|
||||
def lindex(self, name, index): ...
|
||||
def linsert(self, name, where, refvalue, value): ...
|
||||
def llen(self, name): ...
|
||||
def lpop(self, name): ...
|
||||
def lpush(self, name, *values): ...
|
||||
def lpush(self, name: _Str, *values: _Str) -> int: ...
|
||||
def lpushx(self, name, value): ...
|
||||
def lrange(self, name, start, end): ...
|
||||
def lrem(self, name, count, value): ...
|
||||
@@ -176,7 +178,7 @@ class Redis(object):
|
||||
def ltrim(self, name, start, end): ...
|
||||
def rpop(self, name): ...
|
||||
def rpoplpush(self, src, dst): ...
|
||||
def rpush(self, name, *values): ...
|
||||
def rpush(self, name: _Str, *values: _Str) -> int: ...
|
||||
def rpushx(self, name, value): ...
|
||||
def sort(self, name, start=..., num=..., by=..., get=..., desc=..., alpha=..., store=..., groups=...): ...
|
||||
def scan(self, cursor=..., match=..., count=...): ...
|
||||
|
||||
Reference in New Issue
Block a user