diff options
author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2006-12-05 10:26:50 +0100 |
---|---|---|
committer | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2006-12-05 10:26:50 +0100 |
commit | 690a51897fb39719c05c17b4e83c1b0cd7ae0b48 (patch) | |
tree | 79462db7a2f83b9ead07a868b8feb27dc5767400 /tree.py | |
parent | 745345647e2ac1b23ae273a8a5148539fafb3edf (diff) | |
download | logilab-common-690a51897fb39719c05c17b4e83c1b0cd7ae0b48.tar.gz |
flatten testswq
Diffstat (limited to 'tree.py')
-rw-r--r-- | tree.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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): """ |