projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51e3a15
)
skip None checks on a node if we know its constant value as being not None
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 11 Nov 2010 13:32:32 +0000
(14:32 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 11 Nov 2010 13:32:32 +0000
(14:32 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 4ff284cad489e6870484d7d44d9309fbfd93cabc..988048bd1c00a81af1bd15eae6ae4ffb93a1d498 100755
(executable)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-651,7
+651,11
@@
class ExprNode(Node):
return self.result_in_temp()
def may_be_none(self):
- return self.type.is_pyobject
+ if not self.type.is_pyobject:
+ return False
+ if self.constant_result not in (not_a_constant, constant_value_not_set):
+ return self.constant_result is not None
+ return True
def as_cython_attribute(self):
return None