Feat(Core): Change default str function for MO
This commit is contained in:
@@ -35,9 +35,7 @@ class MOFraction(Molecule):
|
||||
>>> print(f.__tex__)
|
||||
\\frac{2}{3}
|
||||
>>> print(f)
|
||||
/
|
||||
> 2
|
||||
> 3
|
||||
2 / 3
|
||||
>>> f = MOFraction(2, 3, negative = True)
|
||||
>>> f
|
||||
<MOFraction - 2 / 3>
|
||||
|
@@ -185,8 +185,7 @@ class Molecule(MO):
|
||||
return self._tree
|
||||
|
||||
def __str__(self):
|
||||
# TODO: à changer pour utiliser .__txt__ |ven. déc. 21 08:30:33 CET 2018
|
||||
return str(self.tree)
|
||||
return str(self.__txt__)
|
||||
|
||||
@property
|
||||
def __txt__(self):
|
||||
|
@@ -29,9 +29,7 @@ class MOstrPower(Molecule):
|
||||
>>> s
|
||||
<MOstrPower x^2>
|
||||
>>> print(s)
|
||||
^
|
||||
> x
|
||||
> 2
|
||||
x^2
|
||||
>>> print(s.__txt__)
|
||||
x^2
|
||||
>>> print(s.__tex__)
|
||||
@@ -133,9 +131,7 @@ class MOMonomial(Molecule):
|
||||
>>> m
|
||||
<MOMonomial 4x>
|
||||
>>> print(m)
|
||||
*
|
||||
> 4
|
||||
> x
|
||||
4x
|
||||
>>> print(m.__txt__)
|
||||
4x
|
||||
>>> print(m.__tex__)
|
||||
@@ -147,9 +143,7 @@ class MOMonomial(Molecule):
|
||||
>>> m
|
||||
<MOMonomial 4x>
|
||||
>>> print(m)
|
||||
*
|
||||
> 4
|
||||
> x
|
||||
4x
|
||||
>>> print(m.__txt__)
|
||||
4x
|
||||
>>> print(m.__tex__)
|
||||
|
Reference in New Issue
Block a user