stdlib: Add several missing __(deep)copy__ methods (#7242)

This commit is contained in:
Alex Waygood
2022-02-17 02:57:41 +00:00
committed by GitHub
parent d869f2e5a3
commit 1091521f60
7 changed files with 26 additions and 2 deletions

View File

@@ -46,6 +46,8 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
def __contains__(self, o: object) -> bool: ...
def __iter__(self) -> Iterator[_KT]: ...
def copy(self) -> WeakValueDictionary[_KT, _VT]: ...
__copy__ = copy
def __deepcopy__(self: Self, memo: Any) -> Self: ...
# These are incompatible with Mapping
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]
def values(self) -> Iterator[_VT]: ... # type: ignore[override]
@@ -84,6 +86,8 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
def __contains__(self, o: object) -> bool: ...
def __iter__(self) -> Iterator[_KT]: ...
def copy(self) -> WeakKeyDictionary[_KT, _VT]: ...
__copy__ = copy
def __deepcopy__(self: Self, memo: Any) -> Self: ...
# These are incompatible with Mapping
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]
def values(self) -> Iterator[_VT]: ... # type: ignore[override]