test_node = UtilNodes.EvalWithTempExprNode(temp, test_node)
return test_node
+ def _handle_simple_function_ord(self, node, pos_args):
+ """Unpack ord(Py_UNICODE).
+ """
+ if len(pos_args) != 1:
+ return node
+ arg = pos_args[0]
+ if isinstance(arg, ExprNodes.CoerceToPyTypeNode):
+ if arg.arg.type is PyrexTypes.c_py_unicode_type:
+ return arg.arg.coerce_to(node.type, self.current_env())
+ return node
+
### special methods
Pyx_tp_new_func_type = PyrexTypes.CFuncType(
--- /dev/null
+
+cimport cython
+
+ustring_with_a = u'abcdefg'
+ustring_without_a = u'bcdefg'
+
+@cython.test_fail_if_path_exists('//SimpleCallNode')
+def unicode_for_loop_ord(unicode s):
+ """
+ >>> unicode_for_loop_ord(ustring_with_a)
+ True
+ >>> unicode_for_loop_ord(ustring_without_a)
+ False
+ """
+ for c in s:
+ if ord(c) == u'a':
+ return True
+ return False