-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: master
Are you sure you want to change the base?
Develop #819
Conversation
person_list.append(person) | ||
|
||
for ind, spouses in enumerate(people): | ||
if "wife" in spouses and spouses["wife"] is not None: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
No description provided.