This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Dict unpacking propagates wrong type #412
Open
Description
a, b = {1: "x", 2.0: 1j}
The way iterable unpacking works, a
and b
should have types based on the keys of the dict
, since that's what you get when you convert to the functionally equivalent:
d = {1: "x", 2.0: 1j}
it = iter(d)
a = it.next()
b = it.next()
But, we get:
a
is being given the value type, and b
probably the first value's type.
Likely related is what happens when changing this to:
a, *b = {1: "x", 2.0: 1j}
b
has no type, but should be a list.
Found in #334.