Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Commit 2e6e65d

Browse files
committed
add marker __repr__ functions, make __str__ formal
1 parent 5b5b002 commit 2e6e65d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

robot/markers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,12 @@ def spherical(self) -> SphericalCoord:
168168
"""
169169
return SphericalCoord(*self._raw_data['spherical'])
170170

171+
def __repr__(self):
172+
return "<robot.markers.{} >".format(self.__str__())
173+
171174
def __str__(self):
172175
bearing = self.spherical.rot_y_degrees
173-
return "<Marker {}: {:.0f}° {}, {:.2f}m away>".format(
176+
return "Marker {}: {:.0f}° {}, {:.2f}m away".format(
174177
self.id,
175178
abs(bearing),
176179
"right" if bearing > 0 else "left",

0 commit comments

Comments
 (0)