add a doctest for Tree

This commit is contained in:
Bertrand Benjamin 2018-02-02 18:33:08 +03:00
parent 451dce91e5
commit 5123dc0f8a
1 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,14 @@ class Tree(object):
| > 2
| > 3
> 4
>>> t = Tree.from_str("2+3*n")
>>> print(t)
+
> 2
> *
| > 3
| > n
"""
t = MutableTree.from_str(expression)
return cls.from_any_tree(t)