[redis] add some missing stubs to redis (#3907)

This commit is contained in:
Vishal Kuo
2020-04-04 18:51:06 -10:00
committed by GitHub
parent 8b3e27d76d
commit 12b53fa46d

View File

@@ -35,6 +35,7 @@ def parse_zscan(response, **options): ...
def parse_slowlog_get(response, **options): ...
_Str = Union[bytes, float, int, Text]
_Key = Union[Text, bytes]
class Redis(object):
RESPONSE_CALLBACKS: Any
@@ -121,9 +122,9 @@ class Redis(object):
def dump(self, name): ...
def exists(self, *names: Text) -> int: ...
__contains__: Any
def expire(self, name: Union[Text, bytes], time: Union[int, timedelta]) -> bool: ...
def expire(self, name: _Key, time: Union[int, timedelta]) -> bool: ...
def expireat(self, name, when): ...
def get(self, name: Union[Text, bytes]) -> Any: ... # Optional[Union[str, bytes]] depending on decode_responses
def get(self, name: _Key) -> Any: ... # Optional[Union[str, bytes]] depending on decode_responses
def __getitem__(self, name): ...
def getbit(self, name, offset): ...
def getrange(self, key, start, end): ...
@@ -147,7 +148,7 @@ class Redis(object):
def restore(self, name, ttl, value): ...
def set(
self,
name: Union[Text, bytes],
name: _Key,
value: _Str,
ex: Union[None, int, timedelta] = ...,
px: Union[None, int, timedelta] = ...,
@@ -183,8 +184,8 @@ class Redis(object):
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: int = ..., match: Optional[Union[Text, bytes]] = ..., count: Optional[int] = ...) -> Tuple[int, List[Any]]: ... # Tuple[int, List[Union[Text, bytes]]] depending on decode_responses
def scan_iter(self, match: Optional[Text] = ..., count: Optional[int] = ...) -> Iterator[Any]: ... # Iterator[Union[Text, bytes]] depending on decode_responses
def scan(self, cursor: int = ..., match: Optional[_Key] = ..., count: Optional[int] = ...) -> Tuple[int, List[Any]]: ... # Tuple[int, List[_Key]] depending on decode_responses
def scan_iter(self, match: Optional[Text] = ..., count: Optional[int] = ...) -> Iterator[Any]: ... # Iterator[_Key] depending on decode_responses
def sscan(self, name, cursor=..., match=..., count=...): ...
def sscan_iter(self, name, match=..., count=...): ...
def hscan(self, name, cursor=..., match=..., count=...): ...
@@ -236,7 +237,9 @@ class Redis(object):
def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...): ...
def xrevrange(self, name, max=..., min=..., count=...): ...
def xtrim(self, name, maxlen, approximate=...): ...
def zadd(self, name, mapping, nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ...): ...
def zadd(
self, name: _Key, mapping: Mapping[_Key, _Str], nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ...
) -> int: ...
def zcard(self, name): ...
def zcount(self, name, min, max): ...
def zincrby(self, name, value, amount=...): ...
@@ -249,7 +252,7 @@ class Redis(object):
def zrem(self, name, *values): ...
def zremrangebylex(self, name, min, max): ...
def zremrangebyrank(self, name, min, max): ...
def zremrangebyscore(self, name, min, max): ...
def zremrangebyscore(self, name: _Key, min: _Str, max: _Str) -> int: ...
def zrevrange(self, name, start, end, withscores=..., score_cast_func=...): ...
def zrevrangebyscore(self, name, max, min, start=..., num=..., withscores=..., score_cast_func=...): ...
def zrevrank(self, name, value): ...