From e80b25d1be12598a515f7285b60376679cda2d3d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 11 Feb 2017 10:10:13 -0800 Subject: [PATCH] allow instantiating ChainMap (#929) A previous PR led mypy to refuse to instantiate ChainMap, because it had unimplemented abstract methods. This PR adds the abstract methods to the stub, which is enough to persuade mypy to allow instantiating ChainMap. --- stdlib/3/collections/__init__.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdlib/3/collections/__init__.pyi b/stdlib/3/collections/__init__.pyi index 0f059ec3d..328644412 100644 --- a/stdlib/3/collections/__init__.pyi +++ b/stdlib/3/collections/__init__.pyi @@ -180,3 +180,9 @@ if sys.version_info >= (3, 3): @property def parents(self) -> ChainMap[_KT, _VT]: ... + + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ...