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

@@ -50,5 +50,9 @@ i2: Iterable[tuple[str, int]] = [("a", 1), ("b", 2)]
assert_type(dict(i2, arg=1), Dict[str, int])
i3: Iterable[str] = ["a.b"]
i4: Iterable[bytes] = [b"a.b"]
assert_type(dict(string.split(".") for string in i3), Dict[str, str])
assert_type(dict(string.split(b".") for string in i4), Dict[bytes, bytes])
dict(["foo", "bar", "baz"]) # type: ignore
dict([b"foo", b"bar", b"baz"]) # type: ignore