mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
redis: complete redis.utils stubs (#5067)
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
from typing import Any
|
||||
from typing import Any, ContextManager, Optional, Text, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
HIREDIS_AVAILABLE: Any
|
||||
from .client import Pipeline, Redis
|
||||
|
||||
def from_url(url, db=..., **kwargs): ...
|
||||
def pipeline(redis_obj): ...
|
||||
_T = TypeVar("_T")
|
||||
|
||||
HIREDIS_AVAILABLE: bool
|
||||
@overload
|
||||
def from_url(url: Text, db: Optional[int] = ..., *, decode_responses: Literal[True], **kwargs: Any) -> Redis[str]: ...
|
||||
@overload
|
||||
def from_url(url: Text, db: Optional[int] = ..., *, decode_responses: Literal[False] = ..., **kwargs: Any) -> Redis[bytes]: ...
|
||||
@overload
|
||||
def str_if_bytes(value: bytes) -> str: ... # type: ignore
|
||||
@overload
|
||||
def str_if_bytes(value: _T) -> _T: ...
|
||||
def safe_str(value: object) -> str: ...
|
||||
def pipeline(redis_obj: Redis) -> ContextManager[Pipeline]: ...
|
||||
|
||||
class dummy: ...
|
||||
|
||||
Reference in New Issue
Block a user