diff --git a/third_party/2and3/redis/client.pyi b/third_party/2and3/redis/client.pyi index d6dab2cf92df..4a76d109ed0c 100644 --- a/third_party/2and3/redis/client.pyi +++ b/third_party/2and3/redis/client.pyi @@ -34,7 +34,7 @@ def parse_hscan(response, **options): ... def parse_zscan(response, **options): ... def parse_slowlog_get(response, **options): ... -_Str = Union[bytes, float, int, Text] +_Value = Union[bytes, float, int, Text] _Key = Union[Text, bytes] class Redis(object): @@ -150,7 +150,7 @@ class Redis(object): def set( self, name: _Key, - value: _Str, + value: _Value, ex: Union[None, int, timedelta] = ..., px: Union[None, int, timedelta] = ..., nx: bool = ..., @@ -167,14 +167,14 @@ class Redis(object): def type(self, name): ... def watch(self, *names): ... def unwatch(self): ... - 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 blpop(self, keys: Union[_Value, Iterable[_Value]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ... + def brpop(self, keys: Union[_Value, Iterable[_Value]], 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: _Str, *values: _Str) -> int: ... + def lpush(self, name: _Value, *values: _Value) -> int: ... def lpushx(self, name, value): ... def lrange(self, name, start, end): ... def lrem(self, name, count, value): ... @@ -182,7 +182,7 @@ class Redis(object): def ltrim(self, name, start, end): ... def rpop(self, name): ... def rpoplpush(self, src, dst): ... - def rpush(self, name: _Str, *values: _Str) -> int: ... + def rpush(self, name: _Value, *values: _Value) -> 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[_Key] = ..., count: Optional[int] = ...) -> Tuple[int, List[Any]]: ... # Tuple[int, List[_Key]] depending on decode_responses @@ -200,11 +200,11 @@ class Redis(object): def sinter(self, keys, *args): ... def sinterstore(self, dest, keys, *args): ... def sismember(self, name, value): ... - def smembers(self, name: _Key) -> Set[_Str]: ... + def smembers(self, name: _Key) -> Set[_Value]: ... def smove(self, src, dst, value): ... def spop(self, name, count: Optional[int] = ...): ... def srandmember(self, name, number=...): ... - def srem(self, name: _Key, *values: _Str) -> int: ... + def srem(self, name: _Key, *values: _Value) -> int: ... def sunion(self, keys, *args): ... def sunionstore(self, dest, keys, *args): ... def xack(self, name, groupname, *ids): ... @@ -239,10 +239,10 @@ class Redis(object): def xrevrange(self, name, max=..., min=..., count=...): ... def xtrim(self, name, maxlen, approximate=...): ... def zadd( - self, name: _Key, mapping: Mapping[_Key, _Str], nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ... + self, name: _Key, mapping: Mapping[_Key, _Value], nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ... ) -> int: ... def zcard(self, name): ... - def zcount(self, name: _Key, min: _Str, max: _Str) -> int: ... + def zcount(self, name: _Key, min: _Value, max: _Value) -> int: ... def zincrby(self, name, value, amount=...): ... def zinterstore(self, dest, keys, aggregate=...): ... def zlexcount(self, name, min, max): ... @@ -253,7 +253,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: _Key, min: _Str, max: _Str) -> int: ... + def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> 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): ... @@ -270,9 +270,9 @@ class Redis(object): def hincrbyfloat(self, name: _Key, key: _Key, amount: float = ...) -> float: ... def hkeys(self, name: _Key) -> List[bytes]: ... def hlen(self, name: _Key) -> int: ... - def hset(self, name: _Key, key: _Key, value: _Str) -> int: ... - def hsetnx(self, name: _Key, key: _Key, value: _Str) -> int: ... - def hmset(self, name: _Key, mapping: Mapping[_Str, _Str]) -> bool: ... + def hset(self, name: _Key, key: _Key, value: _Value) -> int: ... + def hsetnx(self, name: _Key, key: _Key, value: _Value) -> int: ... + def hmset(self, name: _Key, mapping: Mapping[_Value, _Value]) -> bool: ... def hmget(self, name: _Key, keys: Union[_Key, Iterable[_Key]], *args: _Key) -> List[Optional[bytes]]: ... def hvals(self, name: _Key) -> List[bytes]: ... def publish(self, channel: _Key, message: _Key) -> int: ... @@ -321,7 +321,7 @@ class PubSub: def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...) -> Optional[Dict[str, Any]]: ... def handle_message(self, response, ignore_subscribe_messages: bool = ...) -> Optional[Dict[str, Any]]: ... def run_in_thread(self, sleep_time=...): ... - def ping(self, message: Optional[_Str] = ...) -> None: ... + def ping(self, message: Optional[_Value] = ...) -> None: ... class BasePipeline: UNWATCH_COMMANDS: Any