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

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

parent 5beb1f90
...@@ -70,8 +70,9 @@ class MarkAssignments(CythonTransform): ...@@ -70,8 +70,9 @@ 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 function.name == 'reversed' and len(sequence.args) == 1: if sequence.self is None and function.is_name:
sequence = sequence.args[0] if function.name == 'reversed' and len(sequence.args) == 1:
sequence = sequence.args[0]
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 sequence.self is None and function.is_name:
......
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