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

'Solution' #1431

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

'Solution' #1431

wants to merge 1 commit into from

Conversation

CryptoQwest
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 class hierarchy and meeting the task requirements! 🎉 While there are a couple of minor issues, such as the __str__ method being a class method and the alive list being shared among all instances, these do not critically impact the functionality. Consider addressing these for improved code quality. 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! ✨

Comment on lines +23 to +24
@classmethod
def __str__(cls) -> str:

Choose a reason for hiding this comment

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

The __str__ method should not be a class method. It is typically an instance method that returns a string representation of an instance. Consider removing the @classmethod decorator and adjusting the method to return a string representation of an instance, not the class.

@@ -2,0 +1,38 @@
class Animal:
alive = []

Choose a reason for hiding this comment

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

The alive list is a class variable, meaning it is shared among all instances of Animal. If the intention is to track all living animals, this is correct. However, if each instance should have its own alive list, consider making it an instance variable instead.

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