Raymond Hettinger <pyt...@rcn.com> writes: > I'm not sure what you mean by this. What are the semantics of > sorting a tree? Can you outline an example of tree that > could be sorted easily with a cmp function but not a key function?
The idea was that you have a list of trees that you want to sort, and an ordering relation between trees: def gt(tree1, tree2): ... where you recursively descend both trees until you find an unequal pair of nodes. You're not trying to sort the nodes within a single tree. -- http://mail.python.org/mailman/listinfo/python-list