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
1 changed files with 22 additions and 0 deletions

View File

@ -1550,6 +1550,28 @@ class AssocialTree(Tree):
| | | > +
| | | | > x
| | | | > 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:
groups = {}