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

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

Solution #1286

wants to merge 4 commits into from

Conversation

Rabb1t-Artem
Copy link

No description provided.

Copy link

@MrEgorLite MrEgorLite left a comment

Choose a reason for hiding this comment

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

👍

app/main.py Outdated
Comment on lines 17 to 20
return (f"{{Name: {self.name}, "
f"Health: {self.health}, "
f"Hidden: {self.hidden}}}"
)
Copy link

Choose a reason for hiding this comment

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

fix style

app/main.py Outdated


class Carnivore(Animal):
def bite(self, target: object) -> None:
Copy link

Choose a reason for hiding this comment

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

specify target type

app/main.py Outdated
if target.health <= 0:
if target in Animal.alive:
Animal.alive.remove(target)
del target
Copy link

Choose a reason for hiding this comment

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

why? remove that

Copy link
Author

Choose a reason for hiding this comment

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

everything is as in the task

app/main.py Outdated
if target.health <= 0:
if target in Animal.alive:
Animal.alive.remove(target)
del target
Copy link

Choose a reason for hiding this comment

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

why?

app/main.py Outdated


class Carnivore(Animal):
def bite(self, target: Animal) -> None:
Copy link

Choose a reason for hiding this comment

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

you don't use self so you can make it staticmethod or classmethod

app/main.py Outdated
self.name = name
self.health = health
self.hidden = hiden
if self not in Animal.alive:
Copy link

Choose a reason for hiding this comment

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

unnecessary checking

Copy link

@AnyoneClown AnyoneClown left a comment

Choose a reason for hiding this comment

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

Good job!

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.

4 participants