implement Distance class as per readme.md#2783
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
- added int as allowable type for multiplier and divisor
No description provided.