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 #1648

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

Solution #1648

wants to merge 2 commits into from

Conversation

mykyta-mitin
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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":

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":

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.

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.

2 participants