Fix: fraction rendering
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -141,7 +141,7 @@ class Decimal(Token):
|
||||
|
||||
class Fraction(Token):
|
||||
|
||||
""" Token representing a fraction
|
||||
""" Token representing a fraction of numbers
|
||||
|
||||
:example:
|
||||
>>> Fraction("3/4")
|
||||
|
||||
@@ -54,10 +54,16 @@ class Token(object):
|
||||
yield self
|
||||
|
||||
def __repr__(self):
|
||||
return f"<{self.__class__.__name__} {render(self._mo, 'txt')}>"
|
||||
try:
|
||||
return f"<{self.__class__.__name__} {render(self._mo._tree, 'txt')}>"
|
||||
except AttributeError:
|
||||
return f"<{self.__class__.__name__} {render(self._mo, 'txt')}>"
|
||||
|
||||
def __str__(self):
|
||||
return render(self._mo)
|
||||
try:
|
||||
return render(self._mo._tree)
|
||||
except AttributeError:
|
||||
return render(self._mo)
|
||||
|
||||
@property
|
||||
def raw(self):
|
||||
|
||||
Reference in New Issue
Block a user