Doc(Core): Add doctest in organise_by

This commit is contained in:
Bertrand Benjamin 2018-11-23 10:06:07 +01:00
parent 8f99d1e71e
commit 19d936ee8e

View File

@ -1550,6 +1550,28 @@ class AssocialTree(Tree):
| | | > + | | | > +
| | | | > x | | | | > x
| | | | > y | | | | > y
>>> t = AssocialTree.from_str('1/2/3/4')
>>> T = AssocialTree.from_list('+', [5, t])
>>> print(T)
+
> 5
> /
| > /
| | > /
| | | > 1
| | | > 2
| | > 3
| > 4
>>> print(T.organise_by(exclude_nodes=["/"]))
+
> 5
> /
| > /
| | > /
| | | > 1
| | | > 2
| | > 3
| > 4
""" """
if self.node not in exclude_nodes: if self.node not in exclude_nodes:
groups = {} groups = {}