Skip to content

implement Distance class as per readme.md#2783

Open
Ithieltar wants to merge 2 commits into
mate-academy:masterfrom
Ithieltar:develop
Open

implement Distance class as per readme.md#2783
Ithieltar wants to merge 2 commits into
mate-academy:masterfrom
Ithieltar:develop

Conversation

@Ithieltar

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your implementation is approved. The Distance class correctly implements all required magic methods and works as expected with both Distance instances and numeric types. All functional requirements from the task are met. That said, there are two minor annotation improvements worth making for consistency with the checklist specification: 1. In __mul__: Change multiplier: float to multiplier: int | float 2. In __truediv__: Change divisor: float to divisor: int | float. Additionally, the isinstance check and return None path in __truediv__ is unnecessary—per the checklist guidance, explicit type checking isn't required when annotations are correct, so you can remove the if/else block entirely and just let the type annotations document the expected types. These are style and documentation improvements rather than functional issues, so your code works correctly and fulfills the task requirements. Great job implementing all the magic methods and comparison operators!


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

Footnotes

  1. Rate AI review example

- added int as allowable type for multiplier and 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