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

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

Solution #836

wants to merge 5 commits into from

Conversation

VoloIvanchuk
Copy link

No description provided.

app/main.py Outdated
person_list.append(person)

for person_data, person_inst in zip(people, person_list):
if "wife" in person_data and person_data["wife"]:

Choose a reason for hiding this comment

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

Simplify conditions by usage .get method

app/main.py Outdated
for person_data, person_inst in zip(people, person_list):
if "wife" in person_data and person_data["wife"]:
person_inst.wife = Person.get_person(person_data["wife"])
if "husband" in person_data and person_data["husband"]:

Choose a reason for hiding this comment

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

Simplify conditions by usage .get method

app/main.py Outdated
return cls.people.get(name)


def create_person_list(people: dict) -> list:

Choose a reason for hiding this comment

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

specify annotations

app/main.py Outdated

@classmethod
def get_person(cls, name: str) -> str:
return cls.people.get(name)


def create_person_list(people: list) -> list:

Choose a reason for hiding this comment

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

specify annotation

Choose a reason for hiding this comment

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

use list annotations in the format list[int] (this is just an example)

app/main.py Outdated

@classmethod
def get_person(cls, name: str) -> str:
return cls.people.get(name)


def create_person_list(people: list) -> list:

Choose a reason for hiding this comment

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

use list annotations in the format list[int] (this is just an example)

Copy link

@Yurnerroo Yurnerroo 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.

3 participants