mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
add ChainMap class to collections module (#361)
* add ChainMap class to collections module * ...and add it for Python 2 as well.
This commit is contained in:
committed by
Matthias Kramm
parent
e436795124
commit
e815c803a6
@@ -90,3 +90,17 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __init__(self, default_factory: Callable[[], _VT],
|
||||
iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
|
||||
def __missing__(self, key: _KT) -> _VT: ...
|
||||
|
||||
class ChainMap(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ...
|
||||
|
||||
@property
|
||||
def maps(self) -> List[Mapping[_KT, _VT]]: ...
|
||||
|
||||
def new_child(self, m: Mapping[_KT, _VT] = ...) -> ChainMap[_KT, _VT]: ...
|
||||
|
||||
@property
|
||||
def parents(self) -> ChainMap[_KT, _VT]: ...
|
||||
|
||||
Reference in New Issue
Block a user