Feat: set_render to tex for module import and to txt in doctest

This commit is contained in:
2019-06-28 11:43:17 +02:00
parent f037d5545f
commit f1424c8704
6 changed files with 54 additions and 25 deletions

View File

@@ -19,6 +19,8 @@ from decimal import Decimal as _Decimal
from .number import Integer, Decimal, Fraction
from .polynomial import Polynomial, Linear, Quadratic
from .token import Token
__all__ = ["factory"]

View File

@@ -29,6 +29,15 @@ class Token(object):
def random(cls):
raise NotImplemented
@classmethod
def set_render(cls, render):
""" Define default render function
:param render: render name (txt or tex)
"""
cls.RENDER = render
def explain(self):
""" Yield every calculus step which have lead to self