From 773360589e432dfdccc90a68fd30c4f14a1277dd Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 2 Feb 2008 01:07:03 -0800 Subject: [PATCH] Actual conversion on casts with one side Python --- Cython/Compiler/ExprNodes.py | 5 +++++ 1 file changed, 5 insertions(+) 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() -- 2.26.2