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

Implemented necessary classes and methods, but I couldn't find a way to make line 17 shorter without changing the output #707

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

Conversation

raychw
Copy link

@raychw raychw commented Oct 8, 2023

Implemented necessary classes and methods, but I couldn't find a way to make line 17 shorter without changing the output

Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

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

LGTM, well done! One comment is left for consideration.


class Carnivore(Animal):
@classmethod
def bite(cls, herbivore: Animal) -> None:

Choose a reason for hiding this comment

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

You could explicitly indicate in the type annotation as well that you expect a Herbivore instance for the herbivore variable, not a general Animal class instance.

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