Fix: Black does its job

This commit is contained in:
2019-10-13 21:01:31 +02:00
parent aba43c9f19
commit 931e55c35e
14 changed files with 98 additions and 67 deletions

View File

@@ -26,6 +26,7 @@ def moify(token):
except MOError:
return token
@coroutine
def moify_cor(target):
""" Coroutine which try to convert a parsed token into an MO

View File

@@ -101,7 +101,6 @@ class MO(ABC):
raise NotImplementedError
class Atom(MO):
""" Base Math Object with only one component.

View File

@@ -110,6 +110,7 @@ class MOstrPower(Molecule):
'monome2'
"""
return f"monome{self.power}"
def differentiate(self):
""" differentiate a MOstrPower and get a tree
@@ -121,8 +122,10 @@ class MOstrPower(Molecule):
> x^2
"""
if self._power > 2:
return Tree('*', self.power, MOstrPower(self.variable, self._power._value-1))
return Tree('*', self.power, MOstr(self.variable))
return Tree(
"*", self.power, MOstrPower(self.variable, self._power._value - 1)
)
return Tree("*", self.power, MOstr(self.variable))
class MOMonomial(Molecule):