Feat: doctest for composing Expressions

This commit is contained in:
Bertrand Benjamin 2019-07-16 09:31:30 +02:00
parent 3e258b2d41
commit 7600962fe4
1 changed files with 2 additions and 0 deletions

View File

@ -461,6 +461,8 @@ class Expression(object):
<Quadratic 3n^2 + 2n + 1>
>>> f("u_n")
<Exp: 3u_n^2 + 2u_n + 1>
>>> f(f)
<Polynomial 36x^2 + 16x + 6 + 36x^3 + 27x^4>
"""
tree = self._tree
variable = (set(tree.get_leafs(extract_variable)) - {None}).pop()