Oops, should be passing libbe.tree.Tree.sort() args to children. Fixed.
authorW. Trevor King <wking@drexel.edu>
Tue, 25 Nov 2008 12:12:52 +0000 (07:12 -0500)
committerW. Trevor King <wking@drexel.edu>
Tue, 25 Nov 2008 12:12:52 +0000 (07:12 -0500)
libbe/tree.py

index e6f144ee873d3a1521188a7e7a2a592e319f056a..9e07ee3164d71ed5784a60b96e60cf8763d0a726 100644 (file)
@@ -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):
         """