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

123 #1674

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

123 #1674

wants to merge 1 commit into from

Conversation

Odin-max
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 code meets the task requirements and constraints effectively. While there are some minor issues with return type annotations for certain methods, these do not impact the overall functionality. Correcting these annotations will enhance code clarity and correctness. Keep up the good work and continue refining your skills! 😊

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

def __init__(self, km: float) -> None:
self.km = km

def __str__(self) -> None:

Choose a reason for hiding this comment

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

The __str__ method should return a str, not None. Update the return type annotation to str.

def __str__(self) -> None:
return f"Distance: {self.km} kilometers."

def __repr__(self) -> None:

Choose a reason for hiding this comment

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

The __repr__ method should return a str, not None. Update the return type annotation to str.

raise ZeroDivisionError("Cannot divide by zero.")
return NotImplemented

def __lt__(self, other: "Distance") -> "Distance":

Choose a reason for hiding this comment

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

The __lt__ method should return a bool, not Distance. Update the return type annotation to bool.

return self.km < other
return NotImplemented

def __gt__(self, other: "Distance") -> "Distance":

Choose a reason for hiding this comment

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

The __gt__ method should return a bool, not Distance. Update the return type annotation to bool.

return self.km > other
return NotImplemented

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

Choose a reason for hiding this comment

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

The __eq__ method should return a bool, not Distance. Update the return type annotation to bool.

return self.km == other
return NotImplemented

def __le__(self, other: "Distance") -> "Distance":

Choose a reason for hiding this comment

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

The __le__ method should return a bool, not Distance. Update the return type annotation to bool.

return self.km <= other
return NotImplemented

def __ge__(self, other: "Distance") -> "Distance":

Choose a reason for hiding this comment

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

The __ge__ method should return a bool, not Distance. Update the return type annotation to bool.

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