api position objects now implements __str__ and __repr__

This commit is contained in:
Joel 2021-03-04 21:48:54 +01:00
parent 08675bdc5c
commit a7d1fca14a
No known key found for this signature in database
GPG key ID: BDDDBECD0808290E
4 changed files with 10 additions and 4 deletions

View file

@ -65,6 +65,12 @@ class Position:
self.y = y
self.degrees = degrees
def __repr__(self):
return f"Position(x={self.x}, y={self.y}, degrees={self.degrees})"
def __str__(self):
return f"Position(x={round(self.x, 5)}, y={round(self.y, 5)}, degrees={round(self.degrees, 5)})"
class DoubleElim:
"""Class used for communicating with double elimination api