-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redis: complete redis.utils stubs (#5067)
- Loading branch information
Guilhem C
authored
Feb 25, 2021
1 parent
08b26b9
commit bf583da
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ... |