Fix dict type if constructing with kwargs (#4987)

Closes #4846
This commit is contained in:
Sebastian Rittau
2021-03-23 03:30:01 +01:00
committed by GitHub
parent 0cea325bc7
commit 29061d36ae

View File

@@ -753,10 +753,10 @@ class list(MutableSequence[_T], Generic[_T]):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
# NOTE: Keyword arguments are special. If they are used, _KT must include
# str, but we have no way of enforcing it here.
@overload
def __init__(self, **kwargs: _VT) -> None: ...
def __init__(self: Dict[_KT, _VT]) -> None: ...
@overload
def __init__(self: Dict[str, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
@overload