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

Coluton #842

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

Coluton #842

wants to merge 3 commits into from

Conversation

OleksiiMi
Copy link

No description provided.

@OleksiiMi
Copy link
Author

важка тема для розуміння, в години котрі вказані в гуглдок файлі точно не вклався

app/main.py Outdated

def create_person_list(people: list[dict]) -> list:

people_list = [Person(i["name"], i["age"]) for i in people]
Copy link

Choose a reason for hiding this comment

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

i bad variable name

app/main.py Outdated
people_list = [Person(i["name"], i["age"]) for i in people]
for i in people:
if i.get("wife"):
Person.people[i["name"]].wife = Person.people[i["wife"]]
Copy link

Choose a reason for hiding this comment

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

use get()

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 understand, one more "get"?

@OleksiiMi OleksiiMi requested a review from vsmutok November 8, 2023 17:05
app/main.py Outdated
Comment on lines 14 to 20
for preson in people:
if preson.get("wife"):
Person.people[preson["name"]].wife \
= Person.people[preson["wife"]]
if preson.get("husband"):
Person.people[preson["name"]].husband \
= Person.people[preson["husband"]]
Copy link

Choose a reason for hiding this comment

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

Suggested change
for preson in people:
if preson.get("wife"):
Person.people[preson["name"]].wife \
= Person.people[preson["wife"]]
if preson.get("husband"):
Person.people[preson["name"]].husband \
= Person.people[preson["husband"]]
for preson in people:
person_instance = Person.people[preson.get("name")]
if preson.get("wife"):
person_instance.wife = Person.people[preson.get("wife")]
if preson.get("husband"):
person_instance.husband = Person.people[preson.get("husband")]

@OleksiiMi OleksiiMi requested a review from vsmutok November 9, 2023 02:40
Copy link

@ArsenPidhoretskyi ArsenPidhoretskyi left a comment

Choose a reason for hiding this comment

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

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