mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Fixes inaccuracies in redis scan methods (#3870)
The scan() and scan_iter() methods for redis Client objects had incorrect stubs, this has been fixed. Tested on pyredis 3.3.8; the output of those functions does depend on the `decode_responses` configuration, so Any was used instead of a Union return type.
This commit is contained in:
6
third_party/2and3/redis/client.pyi
vendored
6
third_party/2and3/redis/client.pyi
vendored
@@ -1,5 +1,5 @@
|
||||
from datetime import timedelta
|
||||
from typing import Any, Iterable, Text, Optional, Mapping, Tuple, Union, Callable, List, Dict
|
||||
from typing import Any, Iterable, Iterator, Text, Optional, Mapping, Tuple, Union, Callable, List, Dict
|
||||
|
||||
from .connection import ConnectionPool
|
||||
|
||||
@@ -183,8 +183,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[Text] = ..., count: Optional[int] = ...) -> List[Text]: ...
|
||||
def scan_iter(self, match: Optional[Text] = ..., count: Optional[int] = ...) -> List[Text]: ...
|
||||
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 sscan(self, name, cursor=..., match=..., count=...): ...
|
||||
def sscan_iter(self, name, match=..., count=...): ...
|
||||
def hscan(self, name, cursor=..., match=..., count=...): ...
|
||||
|
||||
Reference in New Issue
Block a user