dict.__init__: support dict(string.split(sep) for string in iterable) (#6050)

This commit is contained in:
Akuli
2021-09-20 14:52:41 +03:00
committed by GitHub
parent aff3e4d1c5
commit 196f69b27e

View File

@@ -812,6 +812,10 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
# Next overload is for dict(string.split(sep) for string in iterable)
# Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error
@overload
def __init__(self: dict[str, str], iterable: Iterable[list[str]]) -> None: ...
def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
def clear(self) -> None: ...
def copy(self) -> dict[_KT, _VT]: ...