Improve constructor for builtins.dict (#8517)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Nikita SobolevandAlex Waygood authored and GitHub committed 2022-08-10 19:04:07 +01:00
1 parent 5cc966cc57
commit 510feeb3fc
4 files changed
+67 -6

No files matched your search

+6 -2
View File
@@ -41,9 +41,13 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self: UserDict[str, _VT], __dict: None = ..., **kwargs: _VT) -> None: ...
@overload
def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT]) -> None: ...
@overload
def __init__(self, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __init__(self: UserDict[str, _VT], __dict: SupportsKeysAndGetItem[str, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
@overload
def __init__(self: UserDict[str, _VT], __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> None: ...
@overload
def __init__(self: UserDict[str, str], __iterable: Iterable[list[str]]) -> None: ...
def __len__(self) -> int: ...