projects
/
be.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f3f492
)
Oops, should be passing libbe.tree.Tree.sort() args to children. Fixed.
author
W. Trevor King
<wking@drexel.edu>
Tue, 25 Nov 2008 12:12:52 +0000
(07:12 -0500)
committer
W. Trevor King
<wking@drexel.edu>
Tue, 25 Nov 2008 12:12:52 +0000
(07:12 -0500)
libbe/tree.py
patch
|
blob
|
history
diff --git
a/libbe/tree.py
b/libbe/tree.py
index e6f144ee873d3a1521188a7e7a2a592e319f056a..9e07ee3164d71ed5784a60b96e60cf8763d0a726 100644
(file)
--- 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):
"""