add a doctest for Tree
This commit is contained in:
parent
451dce91e5
commit
5123dc0f8a
@ -76,6 +76,14 @@ class Tree(object):
|
|||||||
| > 2
|
| > 2
|
||||||
| > 3
|
| > 3
|
||||||
> 4
|
> 4
|
||||||
|
>>> t = Tree.from_str("2+3*n")
|
||||||
|
>>> print(t)
|
||||||
|
+
|
||||||
|
> 2
|
||||||
|
> *
|
||||||
|
| > 3
|
||||||
|
| > n
|
||||||
|
|
||||||
"""
|
"""
|
||||||
t = MutableTree.from_str(expression)
|
t = MutableTree.from_str(expression)
|
||||||
return cls.from_any_tree(t)
|
return cls.from_any_tree(t)
|
||||||
|
Loading…
Reference in New Issue
Block a user