From: Stefan Behnel Date: Fri, 12 Feb 2010 18:04:24 +0000 (+0100) Subject: smarter type analysis in BinopNode: propagate known Python result types X-Git-Tag: 0.13.beta0~340^2~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e41403170ca61556b749ca93e8761ccaece6f81;p=cython.git smarter type analysis in BinopNode: propagate known Python result types --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 7be86a8d..a6b52f7d 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4706,7 +4706,9 @@ class BinopNode(ExprNode): self.operand2.analyse_types(env) if self.is_py_operation(): self.coerce_operands_to_pyobjects(env) - self.type = py_object_type + self.type = self.result_type(self.operand1.type, + self.operand2.type) + assert self.type.is_pyobject self.is_temp = 1 elif self.is_cpp_operation(): self.analyse_cpp_operation(env)