summaryrefslogtreecommitdiff
path: root/tree.py
diff options
context:
space:
mode:
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>2006-12-05 10:26:50 +0100
committerAlexandre Fayolle <alexandre.fayolle@logilab.fr>2006-12-05 10:26:50 +0100
commit690a51897fb39719c05c17b4e83c1b0cd7ae0b48 (patch)
tree79462db7a2f83b9ead07a868b8feb27dc5767400 /tree.py
parent745345647e2ac1b23ae273a8a5148539fafb3edf (diff)
downloadlogilab-common-690a51897fb39719c05c17b4e83c1b0cd7ae0b48.tar.gz
flatten testswq
Diffstat (limited to 'tree.py')
-rw-r--r--tree.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tree.py b/tree.py
index 435b3f0..80f56fc 100644
--- a/tree.py
+++ b/tree.py
@@ -190,7 +190,14 @@ class Node :
"""
return a list with all the nodes descendant from this node
"""
- return flatten(self)
+ if _list is None:
+ _list = []
+ _list.append(self)
+ for c in self.children:
+ c.flatten(_list)
+ return _list
+
+## return flatten(self)
def lineage(self):
"""