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

implemented py-distance-class #1716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Viktor-Stadnik
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! 🎉 The functionality is mostly correct, and you've done well with operator overloading and type annotations. There are just a couple of minor improvements to consider: updating the type hint for the __eq__ method to include int and float, and fixing the missing parenthesis in the __iadd__ method's type hint. These tweaks will enhance the code's clarity and robustness. Keep up the excellent work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +16 to +17
def __iadd__(self, other: Distance | int | float
) -> Distance | int | float:

Choose a reason for hiding this comment

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

There is a missing closing parenthesis in the type hint for the __iadd__ method. It should be Distance | int | float) instead of Distance | int | float.

else:
raise TypeError("Type is not correct")

def __eq__(self, other: Distance) -> bool:

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 __eq__ method should include int and float since the method implementation allows comparison with these types. Update the type hint to Distance | int | float.

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