Harmonise UserDict.fromkeys with dict.fromkeys (#6488)

This commit is contained in:
Alex Waygood
2021-12-04 12:56:30 +00:00
committed by GitHub
parent da895e3944
commit 9e0ee447c6
2 changed files with 9 additions and 2 deletions

View File

@@ -842,7 +842,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def keys(self) -> dict_keys[_KT, _VT]: ...
def values(self) -> dict_values[_KT, _VT]: ...
def items(self) -> dict_items[_KT, _VT]: ...
# Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods in `collections.OrderedDict`/`collections.ChainMap`
# Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections`
# TODO: the true signature of `dict.fromkeys` is not expressable in the current type system.
# See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963.
@classmethod