Commit 5f7c7f21 authored by Stefan Behnel's avatar Stefan Behnel

fix for-in loop type inference after reversed() changes

parent 5beb1f90
...@@ -70,6 +70,7 @@ class MarkAssignments(CythonTransform): ...@@ -70,6 +70,7 @@ class MarkAssignments(CythonTransform):
sequence = node.iterator.sequence sequence = node.iterator.sequence
if isinstance(sequence, ExprNodes.SimpleCallNode): if isinstance(sequence, ExprNodes.SimpleCallNode):
function = sequence.function function = sequence.function
if sequence.self is None and function.is_name:
if function.name == 'reversed' and len(sequence.args) == 1: if function.name == 'reversed' and len(sequence.args) == 1:
sequence = sequence.args[0] sequence = sequence.args[0]
if isinstance(sequence, ExprNodes.SimpleCallNode): if isinstance(sequence, ExprNodes.SimpleCallNode):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment