Feat(Core): Change default str function for MO

This commit is contained in:
2018-12-21 12:20:13 +01:00
parent 092fd3c0a7
commit 9a68b826a3
10 changed files with 159 additions and 513 deletions

View File

@@ -84,6 +84,8 @@ def mul2txt(left, right):
>>> a = MO.factory('x')
>>> mul2txt(MO.factory(3), a)
'3x'
>>> mul2txt(MO.factory(-3), a)
'- 3x'
>>> mul2txt(a, a)
'x * x'
"""
@@ -92,8 +94,11 @@ def mul2txt(left, right):
left_ = render_with_parenthesis(left, "*")
right_ = render_with_parenthesis(right, "*")
if (right_[0].isalpha() and (left_.isnumeric() or left_.isdecimal())) or \
right_[0] == '(':
if right_[0].isalpha():
# TODO: C'est bien beurk en dessous... |ven. déc. 21 12:03:07 CET 2018
if type(left).__name__ == 'MOnumber':
display_time = False
elif right_[0] == '(':
display_time = False
if display_time: