Skip to content

error with double tuple assignment #974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wcbeard opened this issue Nov 8, 2015 · 2 comments
Closed

error with double tuple assignment #974

wcbeard opened this issue Nov 8, 2015 · 2 comments
Assignees
Labels
bug mypy got something wrong

Comments

@wcbeard
Copy link

wcbeard commented Nov 8, 2015

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.

@JukkaL JukkaL added the bug mypy got something wrong label Nov 15, 2015
@JukkaL
Copy link
Collaborator

JukkaL commented Nov 15, 2015

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

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 15, 2015

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

c = 1, 2
a, b = c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants