Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
stdlib/2and3/builtins: change dict.fromkeys to classmethod (python#3798)
Browse files Browse the repository at this point in the history
The referenced issue in mypy is fixed.
  • Loading branch information
bluetech authored Mar 2, 2020
1 parent 9500296 commit 36c6f94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions stdlib/2/__builtin__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
8 changes: 4 additions & 4 deletions stdlib/2and3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down

0 comments on commit 36c6f94

Please sign in to comment.