From: Robert Bradshaw Date: Sat, 2 Feb 2008 09:07:03 +0000 (-0800) Subject: Actual conversion on casts with one side Python X-Git-Tag: 0.9.6.14~29^2~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=773360589e432dfdccc90a68fd30c4f14a1277dd;p=cython.git Actual conversion on casts with one side Python --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 6f6f6d99..7c548864 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2608,6 +2608,11 @@ class TypecastNode(ExprNode): if to_py and not from_py: self.result_ctype = py_object_type self.is_temp = 1 + if self.operand.type.to_py_function: + self.operand = self.operand.coerce_to_pyobject(env) + elif from_py and not to_py: + if self.type.from_py_function: + self.operand = self.operand.coerce_to(self.type, env) def check_const(self): self.operand.check_const()