Commit 9bf3b15c authored by Stefan Behnel's avatar Stefan Behnel

do not depend on reversed(range()) bounds having a numeric type and just use...

do not depend on reversed(range()) bounds having a numeric type and just use whatever spanning type we find
parent ff852bac
......@@ -669,7 +669,7 @@ class IterationTransform(Visitor.EnvTransform):
bound1_value = step_value * ((begin_value - end_value - 1) // step_value) + end_value + 1
bound1 = ExprNodes.IntNode(
bound1.pos, value=str(bound1_value), constant_result=bound1_value,
type=PyrexTypes.widest_numeric_type(bound1.type, bound2.type))
type=PyrexTypes.spanning_type(bound1.type, bound2.type))
else:
# FIXME: Optimize when variable is in range (e.g. reversed(range(x, y, 3)))
return node
......
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