aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbe/tree.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbe/tree.py b/libbe/tree.py
index e6f144e..9e07ee3 100644
--- a/libbe/tree.py
+++ b/libbe/tree.py
@@ -39,6 +39,9 @@ class Tree(list):
>>> a.branch_len()
5
+ >>> a.sort(key=lambda node : -node.branch_len())
+ >>> "".join([node.n for node in a.traverse()])
+ 'acfhiebdg'
>>> a.sort(key=lambda node : node.branch_len())
>>> "".join([node.n for node in a.traverse()])
'abdgcefhi'
@@ -93,7 +96,7 @@ class Tree(list):
"""
list.sort(self, *args, **kwargs)
for child in self:
- child.sort()
+ child.sort(*args, **kwargs)
def traverse(self, depthFirst=True):
"""