Improve dict.fromkeys() with None value (#5514)

Closes: #5512
This commit is contained in:
Sebastian Rittau
2021-05-21 19:30:33 +02:00
committed by GitHub
parent 19d6129624
commit acca3181ed

View File

@@ -810,10 +810,10 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def items(self) -> ItemsView[_KT, _VT]: ...
@classmethod
@overload
def fromkeys(cls, __iterable: Iterable[_T]) -> Dict[_T, Any]: ...
def fromkeys(cls, __iterable: Iterable[_T], __value: None = ...) -> dict[_T, Optional[Any]]: ...
@classmethod
@overload
def fromkeys(cls, __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: ...