Support dict(foo.split() for foo in bar) with bytes (#10072)

This commit is contained in:
Akuli
2023-04-22 18:28:34 +03:00
committed by GitHub
parent d74bea5e87
commit 03b8c60a02
4 changed files with 11 additions and 1 deletions

View File

@@ -1032,10 +1032,12 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __init__(self, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
@overload
def __init__(self: dict[str, _VT], __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> None: ...
# Next overload is for dict(string.split(sep) for string in iterable)
# Next two overloads are 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: ...
@overload
def __init__(self: dict[bytes, bytes], __iterable: Iterable[list[bytes]]) -> None: ...
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
def copy(self) -> dict[_KT, _VT]: ...
def keys(self) -> dict_keys[_KT, _VT]: ...