-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Solution #1409
Conversation
There was a problem hiding this 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 = [] |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
No description provided.