From: Stefan Behnel Date: Thu, 18 Dec 2008 08:58:55 +0000 (+0100) Subject: better error messages during constant folding, forward constants also through type... X-Git-Tag: 0.11-beta~120 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e0e71d4fe4992f0a181252648fe2851340869a72;p=cython.git better error messages during constant folding, forward constants also through type coercion --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 00d8f2e9..d9c4f9b8 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -27,7 +27,8 @@ try: except NameError: from sets import Set as set -not_a_constant = object() +class NotConstant(object): pass # just for the name +not_a_constant = NotConstant() constant_value_not_set = object() class ExprNode(Node): @@ -4839,6 +4840,9 @@ class CoercionNode(NewTempExprNode): self.arg = arg if debug_coercion: print("%s Coercing %s" % (self, self.arg)) + + def calculate_constant_result(self): + self.constant_result = self.arg.constant_result def annotate(self, code): self.arg.annotate(code)