-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #1648
base: master
Are you sure you want to change the base?
Solution #1648
Conversation
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.
Great job on implementing the Distance
class with all the required functionalities! 🎉 The class is well-structured, and you've successfully incorporated operator overloading for arithmetic and comparison operations. While there are minor issues with type hints in the __truediv__
and __mul__
methods, these do not impact the overall functionality. Keep up the excellent work, and consider refining the type hints for even better code clarity in the future! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
return NotImplemented | ||
return self | ||
|
||
def __mul__(self, factor: "Distance") -> "Distance": |
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.
The type hint for the factor
parameter in the __mul__
method should be (int, float)
instead of "Distance"
, as this method is designed to multiply the distance by a numeric factor.
else: | ||
return NotImplemented | ||
|
||
def __truediv__(self, divisor: "Distance") -> "Distance": |
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.
The type hint for the divisor
parameter in the __truediv__
method should be (int, float)
instead of "Distance"
, as this method is designed to divide the distance by a numeric divisor.
No description provided.