mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
dict.fromkeys supports arbitrary iterables. (#2012)
This should fix #1529.
This commit is contained in:
committed by
Jelle Zijlstra
parent
df55343e60
commit
8e3182dafa
@@ -672,10 +672,10 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def items(self) -> ItemsView[_KT, _VT]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def fromkeys(seq: Sequence[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328)
|
||||
def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328)
|
||||
@staticmethod
|
||||
@overload
|
||||
def fromkeys(seq: Sequence[_T], value: _S) -> Dict[_T, _S]: ...
|
||||
def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, k: _KT) -> _VT: ...
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user