stdlib/2and3/builtins: change dict.fromkeys to classmethod (#3798)

The referenced issue in mypy is fixed.
This commit is contained in:
Ran Benita
2020-03-02 09:25:52 +02:00
committed by GitHub
parent 95002966ec
commit 36c6f94de4
2 changed files with 8 additions and 8 deletions

View File

@@ -996,12 +996,12 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def viewkeys(self) -> KeysView[_KT]: ...
def viewvalues(self) -> ValuesView[_VT]: ...
def viewitems(self) -> ItemsView[_KT, _VT]: ...
@staticmethod
@classmethod
@overload
def fromkeys(__iterable: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328)
@staticmethod
def fromkeys(cls, __iterable: Iterable[_T]) -> Dict[_T, Any]: ...
@classmethod
@overload
def fromkeys(__iterable: Iterable[_T], __value: _S) -> Dict[_T, _S]: ...
def fromkeys(cls, __iterable: 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: ...