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 #1409

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution #1409

wants to merge 2 commits into from

Conversation

Bleit1
Copy link

@Bleit1 Bleit1 commented Dec 8, 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.

Great job on implementing the task requirements! 🎉 Your code meets all the core requirements, and the class structure is well-organized. While there are minor suggestions regarding type annotations and the use of class attributes, these do not impact the functionality. Keep up the good work, and consider the feedback for future improvements! 😊

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


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 defined as a class attribute. This means it is shared across all instances of the Animal class. If this is intended to track all living animals globally, it's fine. Otherwise, consider using an instance attribute if you want each animal to have its own list.

class Carnivore(Animal):

@staticmethod
def bite(animal: Herbivore | Carnivore) -> None:

Choose a reason for hiding this comment

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

The type annotation Herbivore | Carnivore is correct for Python 3.10 and later. If you need to support earlier versions, consider using Union[Herbivore, Carnivore] from the typing module.

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.

3 participants