mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
dict.__init__: support dict(string.split(sep) for string in iterable) (#6050)
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user