-
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
Solution #836
base: master
Are you sure you want to change the base?
Solution #836
Conversation
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"]: |
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.
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"]: |
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.
Simplify conditions by usage .get method
app/main.py
Outdated
return cls.people.get(name) | ||
|
||
|
||
def create_person_list(people: dict) -> 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.
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: |
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.
specify annotation
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.
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: |
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.
use list annotations in the format list[int] (this is just an example)
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.