self.type = py_object_type
self.gil_check(env)
self.is_temp = 1
- if not arg.type.to_py_function or not arg.type.create_to_py_utility_code(env):
+ if not arg.type.create_to_py_utility_code(env):
error(arg.pos,
"Cannot convert '%s' to Python object" % arg.type)
CoercionNode.__init__(self, arg)
self.type = result_type
self.is_temp = 1
- if not result_type.from_py_function and not result_type.create_from_py_utility_code(env):
+ if not result_type.create_from_py_utility_code(env):
error(arg.pos,
"Cannot convert Python object to '%s'" % result_type)
if self.type.is_string and self.arg.is_ephemeral():
exception_check = 1
def create_to_py_utility_code(self, env):
- return True
+ return self.to_py_function is not None
def create_from_py_utility_code(self, env):
- return True
+ return self.from_py_function is not None
def error_condition(self, result_code):
conds = []
cdef int *p2
i1 = p1 # error
p2 = obj # error
+
+ obj = p2 # error
+
_ERRORS = u"""
5:16: Cannot assign type 'char *' to 'int'
6:17: Cannot convert Python object to 'int *'
+8:17: Cannot convert 'int *' to Python object
"""