Skip to content

Commit

Permalink
Fixed annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnyoneClown committed Oct 22, 2023
1 parent 9d76169 commit b5d657c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __add__(self, other: Distance | int | float) -> Distance:
return Distance(self.km + other.km)
return Distance(self.km + other)

def __iadd__(self, other: Distance | int) -> Distance:
def __iadd__(self, other: Distance | int | float) -> Distance:
if isinstance(other, Distance):
self.km += other.km
else:
Expand All @@ -29,17 +29,17 @@ def __mul__(self, other: int | float) -> Distance:
def __truediv__(self, other: int | float) -> Distance:
return Distance(round((self.km / other), 2))

def __lt__(self, other: int | Distance) -> True | False:
def __lt__(self, other: int | Distance) -> bool:
return self.km < (other.km if isinstance(other, Distance) else other)

def __gt__(self, other: int | Distance) -> True | False:
def __gt__(self, other: int | Distance) -> bool:
return self.km > (other.km if isinstance(other, Distance) else other)

def __eq__(self, other: int | Distance) -> True | False:
def __eq__(self, other: int | Distance) -> bool:
return self.km == (other.km if isinstance(other, Distance) else other)

def __le__(self, other: int | Distance) -> True | False:
def __le__(self, other: int | Distance) -> bool:
return not self > other

def __ge__(self, other: int | Distance) -> True | False:
def __ge__(self, other: int | Distance) -> bool:
return not self < other

0 comments on commit b5d657c

Please sign in to comment.