From 4ff586a394daa045a6927a83cc7ed01526a5126a Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 28 Nov 2008 13:23:23 +0100 Subject: [PATCH] removed caching for subexpr attributes as it can break tree manipulation --- Cython/Compiler/ExprNodes.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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: -- 2.26.2