From: Stefan Behnel Date: Fri, 28 Nov 2008 12:23:23 +0000 (+0100) Subject: removed caching for subexpr attributes as it can break tree manipulation X-Git-Tag: 0.11-beta~189 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4ff586a394daa045a6927a83cc7ed01526a5126a;p=cython.git removed caching for subexpr attributes as it can break tree manipulation --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index ed69fbc1..4096920f 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -196,17 +196,15 @@ class ExprNode(Node): def subexpr_nodes(self): # Extract a list of subexpression nodes based # on the contents of the subexprs class attribute. - if self.saved_subexpr_nodes is None: - nodes = [] - for name in self.subexprs: - item = getattr(self, name) - if item: - if isinstance(item, ExprNode): - nodes.append(item) - else: - nodes.extend(item) - self.saved_subexpr_nodes = nodes - return self.saved_subexpr_nodes + nodes = [] + for name in self.subexprs: + item = getattr(self, name) + if item: + if isinstance(item, ExprNode): + nodes.append(item) + else: + nodes.extend(item) + return nodes def result(self): if not self.is_temp or self.is_target: