removed caching for subexpr attributes as it can break tree manipulation
authorStefan Behnel <scoder@users.berlios.de>
Fri, 28 Nov 2008 12:23:23 +0000 (13:23 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 28 Nov 2008 12:23:23 +0000 (13:23 +0100)
Cython/Compiler/ExprNodes.py

index ed69fbc1c3461e61acfe6a47e00cd68340164954..4096920f2ed78b7b45f65cef564eff28e23880c4 100644 (file)
@@ -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: