Skip to content
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:

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.

Activity

  1. added
    bug
    on Nov 19, 2018
  2. jakebailey commented on Feb 7, 2019

    @jakebailey
    MemberAuthor

    #546 improves this; the first example now works:

    412-1

    But the second does not:

    412-2

  3. added
    gen
    on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions