Fix: clean __str__ method for token
This commit is contained in:
		| @@ -44,7 +44,7 @@ class Token(object): | ||||
|  | ||||
|     def explain(self): | ||||
|         """ Yield every calculus step which have lead to self | ||||
|          | ||||
|  | ||||
|         :example: | ||||
|         >>> from mapytex.calculus.API import Expression | ||||
|         >>> e = Expression.from_str("2+3*4") | ||||
| @@ -67,14 +67,7 @@ class Token(object): | ||||
|         return f"<{self.__class__.__name__} {self.__txt__}>" | ||||
|  | ||||
|     def __str__(self): | ||||
|         if self.RENDER == "tex": | ||||
|             return self.__tex__ | ||||
|         elif self.RENDER == "txt": | ||||
|             return self.__txt__ | ||||
|         else: | ||||
|             raise ValueError(f"Unknow render {self.RENDER}") | ||||
|  | ||||
|         # return renders[self.RENDER](self._mo) | ||||
|         return renders[self.RENDER](self._mo) | ||||
|  | ||||
|     @property | ||||
|     def __txt__(self): | ||||
| @@ -265,7 +258,6 @@ class Token(object): | ||||
|     """ | ||||
|         return self._operate(other, "^") | ||||
|  | ||||
|  | ||||
|     def _roperate(self, other, operation): | ||||
|         """ Make a operation between 2 Tokens """ | ||||
|         from ..expression import Expression | ||||
| @@ -315,6 +307,7 @@ class Token(object): | ||||
|         <Linear x - 3> | ||||
|         """ | ||||
|         return self._roperate(other, "-") | ||||
|  | ||||
|     def __rmul__(self, other): | ||||
|         """ Multiply 2 Tokens or a Token and a Expression | ||||
|  | ||||
| @@ -342,7 +335,6 @@ class Token(object): | ||||
|         """ | ||||
|         return self._roperate(other, "/") | ||||
|  | ||||
|  | ||||
|     def _get_soul(self, other=None): | ||||
|         """ Get the builtin soul of self or other """ | ||||
|         if isinstance(other, Token): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user