Doc(Core): Add doctest in organise_by
This commit is contained in:
parent
8f99d1e71e
commit
19d936ee8e
@ -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 = {}
|
||||
|
Loading…
Reference in New Issue
Block a user