You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
multiple assignments with tuple lvalue raise KeyError - type not stored yet #1438
$ echo "a = b, c = 1, 2" | (PYTHONPATH=. ./scripts/mypy /dev/stdin)
Traceback (most recent call last):
File "./scripts/mypy", line 6, in <module>
main(__file__)
File "/home/alon/mypy/mypy/main.py", line 52, in main
res = type_check_only(sources, bin_dir, options)
File "/home/alon/mypy/mypy/main.py", line 100, in type_check_only
python_path=options.python_path)
File "/home/alon/mypy/mypy/build.py", line 208, in build
dispatch(sources, manager)
File "/home/alon/mypy/mypy/build.py", line 1253, in dispatch
process_graph(graph, manager)
File "/home/alon/mypy/mypy/build.py", line 1384, in process_graph
process_stale_scc(graph, scc)
File "/home/alon/mypy/mypy/build.py", line 1414, in process_stale_scc
graph[id].type_check()
File "/home/alon/mypy/mypy/build.py", line 1233, in type_check
manager.type_checker.visit_file(self.tree, self.xpath)
File "/home/alon/mypy/mypy/checker.py", line 419, in visit_file
self.accept(d)
File "/home/alon/mypy/mypy/checker.py", line 460, in accept
typ = node.accept(self)
File "/home/alon/mypy/mypy/nodes.py", line 753, in accept
return visitor.visit_assignment_stmt(self)
File "/home/alon/mypy/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 0x7f32a220b240>
Activity
alon commentedon Apr 25, 2016
(updated the example to an even simpler one - previously had a,b=c,d=1,2 ; but a simpler one is a=b,c=1,2)
gvanrossum commentedon Apr 25, 2016
Duplicate of #1420.
Avoid crash in edge case of multiple assignment. Fix #974, # 1420, #1438
Avoid crash in edge case of multiple assignment. Fix #974, # 1420, #1438