fifth iteration

This commit is contained in:
Maxim Kurnikov
2018-08-14 12:01:01 +03:00
parent 8cc446150c
commit a13d4c352a
124 changed files with 1455 additions and 5681 deletions

View File

@@ -1,3 +1,4 @@
from collections import OrderedDict
from typing import Any, Callable, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache as BaseCache
@@ -15,7 +16,7 @@ class CacheHandler:
class DefaultCacheProxy:
def __getattr__(
self, name: str
) -> Union[Callable, Dict[str, float], int]: ...
) -> Union[Callable, Dict[str, float], OrderedDict, int]: ...
def __setattr__(self, name: str, value: Callable) -> None: ...
def __delattr__(self, name: Any): ...
def __contains__(self, key: str) -> bool: ...

View File

@@ -1,3 +1,4 @@
from collections import OrderedDict
from typing import Any, Callable, Dict, List, Optional, Union
from django.core.exceptions import ImproperlyConfigured
@@ -21,13 +22,7 @@ class BaseCache:
key_func: Callable = ...
def __init__(
self,
params: Union[
Dict[str, Callable],
Dict[str, Dict[str, int]],
Dict[str, None],
Dict[str, int],
Dict[str, str],
],
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
) -> None: ...
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
def make_key(
@@ -59,7 +54,7 @@ class BaseCache:
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
def get_many(
self, keys: List[str], version: Optional[int] = ...
) -> Union[Dict[str, int], Dict[str, str]]: ...
) -> Dict[str, Union[int, str]]: ...
def get_or_set(
self,
key: str,
@@ -78,9 +73,7 @@ class BaseCache:
def set_many(
self,
data: Union[
Dict[str, Union[Dict[str, int], str]],
Dict[str, bytes],
Dict[str, int],
Dict[str, bytes], Dict[str, int], Dict[str, str], OrderedDict
],
timeout: Any = ...,
version: Optional[Union[int, str]] = ...,

View File

@@ -25,12 +25,7 @@ class BaseDatabaseCache(BaseCache):
def __init__(
self,
table: str,
params: Union[
Dict[str, Callable],
Dict[str, Dict[str, int]],
Dict[str, int],
Dict[str, str],
],
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
) -> None: ...
class DatabaseCache(BaseDatabaseCache):

View File

@@ -12,12 +12,7 @@ class FileBasedCache(BaseCache):
def __init__(
self,
dir: str,
params: Union[
Dict[str, Callable],
Dict[str, Dict[str, int]],
Dict[str, int],
Dict[str, str],
],
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
) -> None: ...
def add(
self,

View File

@@ -1,4 +1,3 @@
from datetime import datetime
from typing import Any, Callable, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache
@@ -12,20 +11,12 @@ class LocMemCache(BaseCache):
def __init__(
self,
name: str,
params: Union[
Dict[str, Callable],
Dict[str, Dict[str, int]],
Dict[str, None],
Dict[str, int],
Dict[str, str],
],
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
) -> None: ...
def add(
self,
key: str,
value: Union[
Dict[str, Union[datetime, str]], Dict[str, int], bytes, int, str
],
value: Union[Dict[str, int], Dict[str, str], bytes, int, str],
timeout: Any = ...,
version: Optional[int] = ...,
) -> Any: ...