mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Support dict(foo.split() for foo in bar) with bytes (#10072)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user