add a doctest for Tree

This commit is contained in:
Bertrand Benjamin 2018-02-02 18:33:08 +03:00
parent 451dce91e5
commit 5123dc0f8a

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)