mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-14 18:27:51 +08:00
Add 2.7 stubs for dict.fromkeys(). Fixes mypy #1176.
This commit is contained in:
1 parent
3ba178ddc4
commit
9cc81d4eeb
1 file changed
+6
@@ -531,6 +531,12 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def iterkeys(self) -> Iterator[_KT]: ...
|
||||
def itervalues(self) -> Iterator[_VT]: ...
|
||||
def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def fromkeys(seq: Sequence[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method
|
||||
@staticmethod
|
||||
@overload
|
||||
def fromkeys(seq: Sequence[_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