Doc(Typing): Typing function return MO

This commit is contained in:
Bertrand Benjamin 2018-11-14 16:04:53 +01:00
parent 3a89bcd24f
commit 298093d97d
4 changed files with 9 additions and 17 deletions

View File

@ -21,7 +21,7 @@ add_doc = """ Add MOs
:param left: left MO
:param right: right MO
:returns: Tree or MO
:returns: MO
"""

View File

@ -18,7 +18,7 @@ divide_doc = """ Typing trees a divide root
:param left: left MO
:param right: right MO
:returns: Tree or MO
:returns: MO
"""

View File

@ -20,7 +20,7 @@ multiply_doc = """ Multiply MOs
:param left: left MO
:param right: right MO
:returns: Tree or MO
:returns: MO
"""
@ -60,12 +60,8 @@ def moscalar_mostrpower(left, right):
>>> a = MOnumber(4)
>>> x = MOstrPower('x', 4)
>>> print(multiply(a, x))
*
> 4
> ^
| > x
| > 4
>>> multiply(a, x)
<MOMonomial 4x^4>
"""
return MOMonomial(left, right)
@ -76,12 +72,8 @@ def mostrpower_moscalar(left, right):
>>> a = MOnumber(4)
>>> x = MOstrPower('x', 4)
>>> print(multiply(x, a))
*
> 4
> ^
| > x
| > 4
>>> multiply(x, a)
<MOMonomial 4x^4>
"""
return MOMonomial(right, left)

View File

@ -19,14 +19,14 @@ power_doc = """ Typing Power of MOs
:param left: left MO
:param right: right MO
:returns: Tree or MO
:returns: MO
"""
power = Dispatcher("power", doc=power_doc)
@power.register(MOstr, MOnumber)
def monumber_monumber(left, right):
def mostr_monumber(left, right):
""" Create MOstrPower over powered MOstr
>>> a = MOstr("x")