-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 #886
base: master
Are you sure you want to change the base?
Solution #886
Conversation
app/main.py
Outdated
if isinstance(other, Distance): | ||
self.km = self.km + other.km | ||
return self | ||
self.km = Distance(self.km + other) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it should write Distance instance in self.km?
app/main.py
Outdated
return Distance(self.km * num) | ||
|
||
def __truediv__(self, other: int | float) -> Distance: | ||
if other != 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I think it's ok that we will raise a default error, where we can't divide by 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.