Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions mathics/builtin/box/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ class InterpretationBox(BoxExpression):
summary_text = "box associated to an input expression"

def __repr__(self):
result = "InterpretationBox\n " + repr(self.inner_box)
result += f"\n {self.box_options}"
return result
if hasattr(self, "inner_box"):
result = "InterpretationBox\n " + repr(self.inner_box)
result += f"\n {self.box_options}"
return result
return "Uninitialized {type(self)} at {id(self)}."

def init(self, *expr, **options):
self.inner_box = expr[0]
Expand Down Expand Up @@ -400,7 +402,9 @@ def __init__(self, *args, **kwargs):
self.inside_list = False

def __repr__(self):
return f"RowBox[{self.elements[0].__repr__()}]"
if hasattr(self, "items"):
return f"RowBox[{self.elements[0].__repr__()}]"
return f"Uninitialized <{type(self)} at {id(self)}.>"

@property
def elements(self):
Expand Down Expand Up @@ -572,7 +576,9 @@ class StyleBox(BoxExpression):
summary_text = "associate boxes with styles"

def __repr__(self):
return repr(self.to_expression())
if hasattr(self, "style"):
return repr(self.to_expression())
return f"Uninitialized {type(self)} at {id(self)}."

@property
def elements(self):
Expand Down
Loading