Solution#2784
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your Distance class implementation is approved and meets all functional requirements. All operations work correctly with both int and float values. The __mul__ and __truediv__ methods are fully functional, though the type annotations specify int rather than int | float as shown in the checklist example. This is a minor annotation discrepancy that doesn't affect runtime behavior—Python doesn't enforce type hints at runtime, and your code handles float values correctly. Consider updating the type annotations to other: int | float for both methods to align with the specification, but this is optional since the implementation is otherwise correct and complete.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| return self | ||
| self.km += other.km | ||
| return self | ||
|
|
There was a problem hiding this comment.
Type annotation specifies int but the task requires int | float. Use other: int | float to match the requirement 'Distance * int/float'
| def __mul__(self, other: int) -> Distance: | ||
| return Distance(self.km * other) | ||
|
|
||
| def __truediv__(self, other: int) -> Distance: |
There was a problem hiding this comment.
Type annotation specifies int but the task requires int | float. Use other: int | float to match the requirement 'Distance / int/float'
No description provided.