if type is unspecified_type:
# if the outer scope defines a type for this variable, inherit it
outer_entry = self.outer_scope.lookup(name)
- if outer_entry and not outer_entry.is_builtin:
+ if outer_entry and outer_entry.is_variable:
type = outer_entry.type # may still be 'unspecified_type' !
# the outer scope needs to generate code for the variable, but
# this scope must hold its name exclusively
"""
return any(x)
+
@cython.test_assert_path_exists("//ForInStatNode",
"//InlinedGeneratorExpressionNode")
@cython.test_fail_if_path_exists("//SimpleCallNode",
"""
return any(x for x in seq)
+
@cython.test_assert_path_exists("//ForInStatNode",
"//InlinedGeneratorExpressionNode")
@cython.test_fail_if_path_exists("//SimpleCallNode",
assert x == 'abc'
return result
+
@cython.test_assert_path_exists("//ForInStatNode",
"//InlinedGeneratorExpressionNode")
@cython.test_fail_if_path_exists("//SimpleCallNode",
lower_ustring = mixed_ustring.lower()
upper_ustring = mixed_ustring.upper()
+
@cython.test_assert_path_exists('//PythonCapiCallNode',
'//ForFromStatNode',
"//InlinedGeneratorExpressionNode")
"""
return any(uchar.islower() for uchar in ustring)
+
@cython.test_assert_path_exists("//ForInStatNode",
"//InlinedGeneratorExpressionNode",
"//InlinedGeneratorExpressionNode//IfStatNode")
cdef int x
return any(x for x in seq)
+
+@cython.test_assert_path_exists("//ForInStatNode",
+ "//InlinedGeneratorExpressionNode",
+ "//InlinedGeneratorExpressionNode//IfStatNode")
+@cython.test_fail_if_path_exists("//SimpleCallNode",
+ "//YieldExprNode")
+def any_in_gen_builtin_name(seq):
+ """
+ >>> any_in_gen_builtin_name([0,1,0])
+ True
+ >>> any_in_gen_builtin_name([0,0,0])
+ False
+
+ >>> any_in_gen_builtin_name(VerboseGetItem([0,0,1,0,0]))
+ 0
+ 1
+ 2
+ True
+ >>> any_in_gen_builtin_name(VerboseGetItem([0,0,0,0,0]))
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ False
+ """
+ return any(type for type in seq)
+
+
@cython.test_assert_path_exists("//ForInStatNode",
"//InlinedGeneratorExpressionNode",
"//InlinedGeneratorExpressionNode//IfStatNode")