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

Develop #819

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

Develop #819

wants to merge 3 commits into from

Conversation

gesiod
Copy link

@gesiod gesiod commented Oct 24, 2023

No description provided.

person_list.append(person)

for ind, spouses in enumerate(people):
if "wife" in spouses and spouses["wife"] is not None:

Choose a reason for hiding this comment

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

is not None should be omitted, it will work without it

Copy link
Author

Choose a reason for hiding this comment

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

I don't think so:
people = [{'age': 30, 'name': 'Ross', 'wife': 'Rachel'}, {'age': 29, 'name': 'Joey', 'wife': None}, ...

Without this additional condition, I don't pass the pytests.

wife = Person.people.get(spouses["wife"])
person_list[ind].wife = wife
wife.husband = person_list[ind]
if "husband" in spouses and spouses["husband"] is not None:

Choose a reason for hiding this comment

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

is not None should be omitted, it will work without it

Copy link
Author

Choose a reason for hiding this comment

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

But it doesn't work)

app/main.py Outdated
def __init__(self, name: str, age: int) -> None:
self.name = name
self.age = age
Person.people.setdefault(name, self)


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.

add more detail type annotation for list

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link

@Polyakiv-Andrey Polyakiv-Andrey 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.

2 participants