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

SOL #767

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

SOL #767

wants to merge 3 commits into from

Conversation

neagarr
Copy link

@neagarr neagarr commented Oct 3, 2023

No description provided.

app/main.py Outdated

for person in people:
if person[list(person.keys())[2]] is not None:
if list(person.keys())[2] == "wife":

Choose a reason for hiding this comment

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

Suggested change
if list(person.keys())[2] == "wife":
if person.get("wife"):

Choose a reason for hiding this comment

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

try do it with get()

app/main.py Outdated
Person(name=person["name"], age=person["age"])

for person in people:
if person[list(person.keys())[2]] is not None:

Choose a reason for hiding this comment

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

it is bad code

@neagarr neagarr requested a review from vasylhnatiuk October 3, 2023 13:23
app/main.py Outdated
for person in people:
if person.get("wife") is not None:
Person.people[person["name"]].wife =\
Person.people[person[list(person.keys())[2]]]

Choose a reason for hiding this comment

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

don't use list(person.keys())[2]] , use key "wife"

@neagarr neagarr requested a review from vasylhnatiuk October 3, 2023 16:42
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