Commit 4f0ff235 authored by Stefan Behnel's avatar Stefan Behnel

disable incorrect optimisation and enable tests for reversed iteration with negative step value

parent 05464697
......@@ -661,6 +661,9 @@ class IterationTransform(Visitor.EnvTransform):
if reversed:
bound1, bound2 = bound2, bound1
if step_value < 0:
if step_value != -1:
# FIXME: not currently supported
return node
step_value = -step_value
if step_value != 1:
begin_value = bound1.constant_result
......
......@@ -253,9 +253,9 @@ def reversed_range_constant():
@cython.test_assert_path_exists('//ForFromStatNode')
@cython.test_fail_if_path_exists('//ForInStatNode')
def FIXME_reversed_range_constant_neg():
FIXME = """
#@cython.test_fail_if_path_exists('//ForInStatNode')
def reversed_range_constant_neg():
"""
>>> [ i for i in _reversed(range(-2, -12, -4)) ]
[-10, -6, -2]
>>> reversed_range_constant_neg()
......
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