Skip to content

Commit 58650cf

Browse files
committed
more informative str and repr methods
1 parent 464f065 commit 58650cf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spatialmath/base/animate.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ def __repr__(self):
260260
:returns: readable version of the display list
261261
:rtype: str
262262
"""
263-
return ", ".join([x.type for x in self.displaylist])
263+
return "Animate(" + ", ".join([x.type for x in self.displaylist]) + ")"
264+
265+
def __str__(self):
266+
return f"Animate(len={len(self.displaylist)}"
264267

265268
def artists(self):
266269
"""
@@ -628,7 +631,10 @@ def __repr__(self):
628631
:returns: readable version of the display list
629632
:rtype: str
630633
"""
631-
return ", ".join([x.type for x in self.displaylist])
634+
return "Animate2(" + ", ".join([x.type for x in self.displaylist]) + ")"
635+
636+
def __str__(self):
637+
return f"Animate2(len={len(self.displaylist)}"
632638

633639
def artists(self):
634640
"""

0 commit comments

Comments
 (0)