projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fabe1ee
)
smarter type analysis in BinopNode: propagate known Python result types
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 12 Feb 2010 18:04:24 +0000
(19:04 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 12 Feb 2010 18:04:24 +0000
(19:04 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 7be86a8d224c8b886a4ec673dbbd62c6fef25584..a6b52f7d59dc6107b15c50e3d5c43a1e35485f2d 100755
(executable)
--- 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)