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

Complite #1652

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

Complite #1652

wants to merge 1 commit into from

Conversation

meff-p
Copy link

@meff-p meff-p commented Dec 26, 2024

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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

Something went wrong while processing the review.
[CODE: 3]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

Something went wrong while processing the review.
[CODE: 3]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

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! 🎉 While there are a few minor type hinting issues, they don't impact the functionality of your code. It's a good practice to specify return types accurately, so consider updating them for clarity. Keep up the good work and happy coding! 😊

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

@@ -1,3 +1,60 @@
class Distance:
# Write your code here
pass
def __init__(self, km: any) -> None:

Choose a reason for hiding this comment

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

The type hint any for the km parameter should be more specific. Consider using int or float if those are the expected types.

def __repr__(self) -> str:
return f"Distance(km={self.km})"

def __add__(self, other: any) -> None:

Choose a reason for hiding this comment

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

The return type for the __add__ method should not be None. It should return a new Distance object, so the return type should be Distance.

elif isinstance(other, (int, float)):
return Distance(self.km + other)

def __iadd__(self, other: any) -> None:

Choose a reason for hiding this comment

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

The return type for the __iadd__ method should not be None. It should return self, so the return type should be Distance.

self.km += other
return self

def __mul__(self, other: any) -> None:

Choose a reason for hiding this comment

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

The return type for the __mul__ method should not be None. It should return a new Distance object, so the return type should be Distance.

if isinstance(other, (int, float)):
return Distance(self.km * other)

def __truediv__(self, other: any) -> None:

Choose a reason for hiding this comment

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

The return type for the __truediv__ method should not be None. It should return a new Distance object, so the return type should be Distance.

if isinstance(other, (int, float)) and other != 0:
return Distance(round(self.km / other, 2))

def __lt__(self, other: any) -> None:

Choose a reason for hiding this comment

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

The return type for the __lt__ method is missing. It should return a 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