Skip to content

error with double tuple assignment #974

Closed

Description

@wcbeard

Not sure how to describe this with words so apologies if this has already been noted.

mypy has no problem checking a = b = 1 or a, b = 1, 2, but chokes on

c = a, b = 1, 2

with KeyError: <mypy.nodes.TupleExpr object at 0x1017950b8>. Full traceback is here.

Activity

  1. JukkaL commented on Nov 15, 2015

    @JukkaL
    Collaborator

    Thanks for reporting this! This is clearly a bug in how mypy handles assignment statements.

  2. JukkaL commented on Nov 15, 2015

    @JukkaL
    Collaborator

    The current workaround is to split the assignment into two or more assignment statements, for example:

    c = 1, 2
    a, b = c
    
  3. added this to the milestone on Apr 28, 2016
  4. self-assigned this
    on Apr 28, 2016
  5. added a commit that references this issue on Apr 29, 2016
    5b7f8d9
  6. added a commit that references this issue on Apr 29, 2016
    fa70fc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmypy got something wrong

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions