Skip to content

Crash on multiple assignment to tuple #1420

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
gvanrossum opened this issue Apr 21, 2016 · 2 comments
Closed

Crash on multiple assignment to tuple #1420

gvanrossum opened this issue Apr 21, 2016 · 2 comments
Assignees
Labels
bug mypy got something wrong

Comments

@gvanrossum
Copy link
Member

Repro:

a, b = c, d = 0, 1

Traceback:

Traceback (most recent call last):
  File "/Users/guido/v3/bin/mypy", line 6, in <module>
    main(__file__)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/main.py", line 52, in main
    res = type_check_only(sources, bin_dir, options)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/main.py", line 100, in type_check_only
    python_path=options.python_path)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/build.py", line 208, in build
    dispatch(sources, manager)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/build.py", line 1251, in dispatch
    process_graph(graph, manager)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/build.py", line 1382, in process_graph
    process_stale_scc(graph, scc)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/build.py", line 1412, in process_stale_scc
    graph[id].type_check()
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/build.py", line 1231, in type_check
    manager.type_checker.visit_file(self.tree, self.xpath)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/checker.py", line 419, in visit_file
    self.accept(d)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/checker.py", line 460, in accept
    typ = node.accept(self)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/nodes.py", line 753, in accept
    return visitor.visit_assignment_stmt(self)
  File "/Users/guido/v3/lib/python3.5/site-packages/mypy/checker.py", line 1147, in visit_assignment_stmt
    rvalue = self.temp_node(self.type_map[s.rvalue], s)
KeyError: <mypy.nodes.TupleExpr object at 0x105d158d0>
@alon
Copy link

alon commented Apr 25, 2016

oops, thanks for finding the duplicate. Just a note, it also fails on the slightly simpler:

a = b, c = 0, 1

@gvanrossum gvanrossum added this to the 0.4 milestone Apr 28, 2016
@gvanrossum gvanrossum self-assigned this Apr 28, 2016
@gvanrossum
Copy link
Member Author

Dupe of #974

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

2 participants