Add __str__ for Heading.

This commit is contained in:
Dan Albert 2023-07-29 21:50:02 -07:00 committed by Raffson
parent 60172d0e52
commit ee1fa78ecd
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -397,6 +397,9 @@ class Heading:
def __sub__(self, other: Heading) -> Heading: def __sub__(self, other: Heading) -> Heading:
return Heading.from_degrees(self.degrees - other.degrees) return Heading.from_degrees(self.degrees - other.degrees)
def __str__(self) -> str:
return f"{self.heading_in_degrees}°"
@dataclass(frozen=True, order=True) @dataclass(frozen=True, order=True)
class Pressure: class Pressure: