aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-25 07:12:52 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-25 07:12:52 -0500
commited4d971d1375a692fbd3a394237f56e851bb5d0e (patch)
tree97dd6472ab40ae0ebec6f3cc785a27b1caa3cdc6
parent0f3f492bd1c9db89b98f719f7371b183c9c8d838 (diff)
downloadbugseverywhere-ed4d971d1375a692fbd3a394237f56e851bb5d0e.tar.gz
Oops, should be passing libbe.tree.Tree.sort() args to children. Fixed.
-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):
"""