From e415a7fad8c962ff950d9416600e16d028baa2ca Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Fri, 13 Aug 2021 19:30:48 +0200 Subject: [PATCH] Make `ChainMap`'s `new_child()` and `parents` return subclass (#5922) --- stdlib/collections/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 0176ea461..c23c58e24 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -286,9 +286,9 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): maps: list[Mapping[_KT, _VT]] def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ... - def new_child(self, m: Mapping[_KT, _VT] | None = ...) -> ChainMap[_KT, _VT]: ... + def new_child(self: Self, m: Mapping[_KT, _VT] | None = ...) -> Self: ... @property - def parents(self) -> ChainMap[_KT, _VT]: ... + def parents(self: Self) -> Self: ... def __setitem__(self, k: _KT, v: _VT) -> None: ... def __delitem__(self, v: _KT) -> None: ... def __getitem__(self, k: _KT) -> _VT: ...