if not counter_type.is_pyobject and not counter_type.is_int:
# nothing we can do here, I guess
return node
-
- if iterable_target.type is not PyrexTypes.py_object_type:
- # this may need conversion, could be made to work
- return node
temp = UtilNodes.LetRefNode(ExprNodes.IntNode(enumerate_function.pos,
value='0',
stats = loop_body)
node.target = iterable_target
+ node.item = node.item.coerce_to(iterable_target.type, self.current_scope)
node.iterator.sequence = enumerate_function.arg_tuple.args[0]
# recurse into loop to check for further optimisations
for i,k in enumerate(range(1,5)):
print i, k
-#T442 @cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
+@cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
def go_c_enumerate():
"""
>>> go_c_enumerate()
for i,k in enumerate(range(1,5)):
print i, k
-#T442 @cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
+@cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
def go_c_enumerate_step():
"""
>>> go_c_enumerate_step()
continue
print u"::", i, k
-# T442 @cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
+@cython.test_fail_if_path_exists("//SimpleCallNode//NameNode[@name = 'enumerate']")
def empty_c_enumerate():
"""
>>> empty_c_enumerate()
for a,(b,(c,d)) in enumerate(enumerate(enumerate(range(1,5)))):
print a,b,c,d
-# T442 @cython.test_fail_if_path_exists("//SimpleCallNode")
+@cython.test_fail_if_path_exists("//SimpleCallNode")
def multi_c_enumerate():
"""
>>> multi_c_enumerate()
for a,(b,(c,d)) in enumerate(enumerate(enumerate(range(1,5)))):
print a,b,c,d
-# T442 @cython.test_fail_if_path_exists("//SimpleCallNode")
+@cython.test_fail_if_path_exists("//SimpleCallNode")
def convert_target_enumerate(L):
"""
>>> convert_target_enumerate([2,3,5])