Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #818

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Solution #818

wants to merge 3 commits into from

Conversation

eLQeR
Copy link

@eLQeR eLQeR commented Oct 26, 2023

No description provided.

app/main.py Outdated
def __str__(self) -> str:
return f"Distance: {self.km} kilometers."

def __add__(self, other: Distance) -> Distance:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other can be int or float as well

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typehinting everywhere

app/main.py Outdated
Comment on lines 26 to 30
def __mul__(self, other: Distance) -> Distance:
return Distance(self.km * other)

def __truediv__(self, other: Distance) -> Distance:
return Distance(round(self.km / other, 2))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other can be only int or float, not Distance

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is related to these 2 cases only

@eLQeR eLQeR requested a review from YukihiroSM October 26, 2023 14:12
Copy link

@NikOneZ1 NikOneZ1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants