fixes, add some testing folders

This commit is contained in:
Maxim Kurnikov
2019-02-04 19:31:37 +03:00
parent 3dcab64e07
commit 69d4ccaf54
31 changed files with 319 additions and 236 deletions

View File

@@ -1,74 +1,58 @@
# Stubs for django.utils.datastructures (Python 3.5)
from collections import OrderedDict
from typing import (
Any,
Callable,
Dict,
Generic,
Iterable,
Iterator,
List,
Mapping,
MutableMapping,
MutableSet,
Optional,
overload,
Tuple,
TypeVar,
Union,
overload,
Iterator,
)
KT = TypeVar("KT")
VT = TypeVar("VT")
_K = TypeVar("_K")
_V = TypeVar("_V")
class OrderedSet(MutableSet[KT], Generic[KT]):
dict = ... # type: OrderedDict[KT, None]
def __init__(self, iterable: Iterable[KT] = None) -> None: ...
def add(self, item: KT) -> None: ...
def remove(self, item: KT) -> None: ...
def discard(self, item: KT) -> None: ...
def __contains__(self, item): ...
def __iter__(self): ...
def __len__(self): ...
class OrderedSet(MutableSet[_K]):
dict: Dict[_K, None] = ...
def __contains__(self, item: object) -> bool: ...
def __iter__(self) -> Iterator[_K]: ...
def __len__(self) -> int: ...
def add(self, x: _K) -> None: ...
def discard(self, item: _K) -> None: ...
class MultiValueDictKeyError(KeyError): ...
class MultiValueDict(MutableMapping[KT, VT], Generic[KT, VT]):
def __init__(self, key_to_list_mapping: Iterable[Tuple[KT, List[VT]]] = ...) -> None: ...
def __copy__(self) -> "MultiValueDict[KT, VT]": ...
def __deepcopy__(self, memo: Dict[int, object]) -> "MultiValueDict[KT, VT]": ...
def __getitem__(self, key: KT) -> Union[VT, List[VT]]: ... # type: ignore
def pop(self, key: KT, default: List[VT] = None) -> List[VT]: ... # type: ignore
def __getstate__(self) -> Dict[str, Any]: ...
def __setstate__(self, obj_dict: Dict[str, Any]) -> None: ...
def get(self, key: KT, default: VT = None) -> Union[Optional[VT], List[VT]]: ... # type: ignore
def getlist(self, key: KT, default: List[VT] = None) -> List[VT]: ...
def setlist(self, key: KT, list_: List[VT]) -> None: ...
def setlistdefault(self, key: KT, default_list: List[VT] = None) -> List[VT]: ...
def appendlist(self, key: KT, value: VT) -> None: ...
def lists(self) -> Iterable[Tuple[KT, List[VT]]]: ...
def copy(self) -> "MultiValueDict[KT, VT]": ...
@overload # type: ignore
def update(self, args: Mapping[KT, VT]) -> None: ...
class MultiValueDict(MutableMapping[_K, List[_V]]):
@overload
def update(self, *args: Mapping[KT, VT], **kwargs: Iterable[Tuple[KT, VT]]) -> None: ... # type: ignore
def dict(self) -> Dict[KT, Union[VT, List[VT]]]: ...
def __init__(self, key_to_list_mapping: Iterable[Tuple[_K, List[_V]]] = ...) -> None: ...
@overload
def __init__(self, key_to_list_mapping: Mapping[_K, List[_V]] = ...) -> None: ...
def getlist(self, key: _K, default: List[_V] = None) -> List[_V]: ...
def setlist(self, key: _K, list_: List[_V]) -> None: ...
def setlistdefault(self, key: _K, default_list: List[_V] = None) -> List[_V]: ...
def appendlist(self, key: _K, value: _V) -> None: ...
def lists(self) -> Iterable[Tuple[_K, List[_V]]]: ...
def dict(self) -> Dict[_K, List[_V]]: ...
# These overrides are needed to convince mypy that this isn't an abstract class
def __delitem__(self, k: KT) -> None: ...
def __setitem__(self, k: KT, v: VT) -> None: ...
def __delitem__(self, item: _K) -> None: ...
def __getitem__(self, item: _K) -> List[_V]: ...
def __setitem__(self, k: _K, v: List[_V]) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[KT]: ...
def __iter__(self) -> Iterator[_K]: ...
class ImmutableList(Tuple[VT, ...], Generic[VT]):
warning = ... # type: str
class ImmutableList(Tuple[_V, ...]):
warning: str = ...
def complain(self, *wargs: Any, **kwargs: Any) -> None: ...
class DictWrapper(Dict[str, VT], Generic[VT]):
func = ... # type: Callable[[VT], VT]
prefix = ... # type: str
class DictWrapper(Dict[str, _V]):
func: Callable[[_V], _V] = ...
prefix: str = ...
@overload
def __init__(self, data: Mapping[str, VT], func: Callable[[VT], VT], prefix: str) -> None: ...
def __init__(self, data: Mapping[str, _V], func: Callable[[_V], _V], prefix: str) -> None: ...
@overload
def __init__(self, data: Iterable[Tuple[str, VT]], func: Callable[[VT], VT], prefix: str) -> None: ...
def __init__(self, data: Iterable[Tuple[str, _V]], func: Callable[[_V], _V], prefix: str) -> None: ...