1 from typing import (Any, Container, Dict, Generic, Iterable, Iterator, List,
\r
2 Mapping, Optional, Sized, Tuple, TypeVar, Union, overload)
\r
8 class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]):
\r
9 data = ... # type: Mapping[_KT, _VT]
\r
11 def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ...
\r
13 # TODO: __iter__ is not available for UserDict
\r
15 class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]):
\r
18 class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]):
\r
19 def has_key(self, key: _KT) -> bool: ...
\r
20 def __len__(self) -> int: ...
\r
21 def __iter__(self) -> Iterator[_KT]: ...
\r
23 # From typing.Mapping[_KT, _VT]
\r
24 # (can't inherit because of keys())
\r
26 def get(self, k: _KT) -> Optional[_VT]: ...
\r
28 def get(self, k: _KT, default: Union[_VT, _T]) -> Union[_VT, _T]: ...
\r
29 def values(self) -> List[_VT]: ...
\r
30 def items(self) -> List[Tuple[_KT, _VT]]: ...
\r
31 def iterkeys(self) -> Iterator[_KT]: ...
\r
32 def itervalues(self) -> Iterator[_VT]: ...
\r
33 def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
\r
34 def __contains__(self, o: Any) -> bool: ...
\r
36 # From typing.MutableMapping[_KT, _VT]
\r
37 def clear(self) -> None: ...
\r
38 def pop(self, k: _KT, default: _VT = ...) -> _VT: ...
\r
39 def popitem(self) -> Tuple[_KT, _VT]: ...
\r
40 def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ...
\r
42 def update(self, m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
\r
44 def update(self, m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
\r