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

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

Solution #751

wants to merge 5 commits into from

Conversation

MykytaPD09
Copy link

No description provided.

app/main.py Outdated
def __init__(self, name: str, health: int = 100) -> None:
self.name = name
self.health = health
self.hidden = False

Choose a reason for hiding this comment

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

Don't hardcode the value for self.hidden. add it to parameters

@MykytaPD09 MykytaPD09 requested a review from pavlejviki October 25, 2023 15:32
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.

One minor change was requested.

app/main.py Outdated


class Carnivore(Animal):
def bite(self, herbivore: int) -> None:

Choose a reason for hiding this comment

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

Change your type annotation, herbivore should not be int.

@MykytaPD09 MykytaPD09 requested a review from Dimosphen1 October 26, 2023 13:33
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.

Several changes were requested.

app/main.py Outdated


class Carnivore(Animal):
def bite(self, herbivore: "Herbivore") -> None:

Choose a reason for hiding this comment

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

Do not use quotes "" in type annotations, declare class directly to indicate that you expect its instance as an input. Use from __future__ import annotations in case you face issues with this syntaxis.

app/main.py Outdated
self,
name: str,
health: int = 100,
hidden: bool = False

Choose a reason for hiding this comment

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

Indicate in type annotation that health and hidden are optional arguments.

@MykytaPD09 MykytaPD09 requested a review from Dimosphen1 November 5, 2023 20:43
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!

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