Problem: If you call str(tree), it is sorted per default. There is no way of obtaining an unsorted string representation of a tree. The __print_backend function is private and can't be called from outside.
The problem is the the sorting parameter in expand_tree(), which is called by many functions, that don't pass the parameters to expand_tree (to_graphviz, leaves, subtree).
Furthermore the interface to sorting is really messed up (the name of the parameter):
If you want to iter a tree unsorted you have to call expand_tree(sorting=False).
You can print a tree unsorted, by calling tree.show(key=False),
If you want to convert a tree to a dictionary, you need to call to_dict(sort=True)
Problem: If you call
str(tree)
, it is sorted per default. There is no way of obtaining an unsorted string representation of a tree. The__print_backend
function is private and can't be called from outside.The problem is the the sorting parameter in
expand_tree()
, which is called by many functions, that don't pass the parameters toexpand_tree
(to_graphviz
,leaves
,subtree
).Furthermore the interface to sorting is really messed up (the name of the parameter):
expand_tree(sorting=False)
.tree.show(key=False)
,to_dict(sort=True)