mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
third iteration of stubs
This commit is contained in:
22
django-stubs/core/cache/backends/base.pyi
vendored
22
django-stubs/core/cache/backends/base.pyi
vendored
@@ -1,4 +1,3 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
@@ -11,7 +10,7 @@ DEFAULT_TIMEOUT: Any
|
||||
MEMCACHE_MAX_KEY_LENGTH: int
|
||||
|
||||
def default_key_func(
|
||||
key: Union[str, int], key_prefix: str, version: Union[str, int]
|
||||
key: Union[int, str], key_prefix: str, version: Union[int, str]
|
||||
) -> str: ...
|
||||
def get_key_func(key_func: Optional[Union[Callable, str]]) -> Callable: ...
|
||||
|
||||
@@ -22,11 +21,17 @@ class BaseCache:
|
||||
key_func: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
params: Dict[str, Optional[Union[Dict[str, int], Callable, str, int]]],
|
||||
params: Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, Dict[str, int]],
|
||||
Dict[str, None],
|
||||
Dict[str, int],
|
||||
Dict[str, str],
|
||||
],
|
||||
) -> None: ...
|
||||
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
|
||||
def make_key(
|
||||
self, key: Union[str, int], version: Optional[Union[str, int]] = ...
|
||||
self, key: Union[int, str], version: Optional[Union[int, str]] = ...
|
||||
) -> str: ...
|
||||
def add(
|
||||
self,
|
||||
@@ -54,14 +59,14 @@ class BaseCache:
|
||||
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
|
||||
def get_many(
|
||||
self, keys: List[str], version: Optional[int] = ...
|
||||
) -> Dict[str, Union[str, int]]: ...
|
||||
) -> Union[Dict[str, int], Dict[str, str]]: ...
|
||||
def get_or_set(
|
||||
self,
|
||||
key: str,
|
||||
default: Optional[Union[Callable, int, str]],
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> Optional[Union[str, int]]: ...
|
||||
) -> Optional[Union[int, str]]: ...
|
||||
def has_key(self, key: Any, version: Optional[Any] = ...): ...
|
||||
def incr(
|
||||
self, key: str, delta: int = ..., version: Optional[int] = ...
|
||||
@@ -73,13 +78,12 @@ class BaseCache:
|
||||
def set_many(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, bytes],
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[str, bytes],
|
||||
Dict[str, int],
|
||||
OrderedDict,
|
||||
],
|
||||
timeout: Any = ...,
|
||||
version: Optional[Union[str, int]] = ...,
|
||||
version: Optional[Union[int, str]] = ...,
|
||||
) -> List[Any]: ...
|
||||
def delete_many(
|
||||
self, keys: Union[Dict[str, str], List[str]], version: None = ...
|
||||
|
||||
Reference in New Issue
Block a user