Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[redis] replaces _Str with _Value as variable info #4281

Merged
merged 1 commit into from
Jun 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions third_party/2and3/redis/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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 = ...,
Expand All @@ -167,22 +167,22 @@ 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): ...
def lset(self, name, index, value): ...
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
Expand All @@ -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): ...
Expand Down Expand Up @@ -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): ...
Expand All @@ -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): ...
Expand All @@ -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: ...
Expand Down Expand Up @@ -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
Expand Down