From 6e41403170ca61556b749ca93e8761ccaece6f81 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 12 Feb 2010 19:04:24 +0100 Subject: [PATCH] smarter type analysis in BinopNode: propagate known Python result types --- Cython/Compiler/ExprNodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.26.2