Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Dict unpacking propagates wrong type #412

Open
jakebailey opened this issue Nov 19, 2018 · 1 comment
Open

Dict unpacking propagates wrong type #412

jakebailey opened this issue Nov 19, 2018 · 1 comment
Labels
bug Something isn't working gen from the generated tests

Comments

@jakebailey
Copy link
Member

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:

image

image

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.

@jakebailey
Copy link
Member Author

#546 improves this; the first example now works:

412-1

But the second does not:

412-2

@jakebailey jakebailey added the gen from the generated tests label Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working gen from the generated tests
Projects
None yet
Development

No branches or pull requests

2 participants