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

solution_for_py_person_class #837

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

Conversation

VladyslavBazhyn
Copy link

No description provided.

app/main.py Outdated
Comment on lines 14 to 16
for person in people:
person = Person(person["name"], person["age"])
person_list.append(person)

Choose a reason for hiding this comment

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

Use list comprehension here, please

app/main.py Outdated
# write your code here
pass

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

Choose a reason for hiding this comment

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

Specify inner type in type hint for return value

app/main.py Outdated
# write your code here
pass

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

Choose a reason for hiding this comment

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

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

Copy link

@EdAlekseiev EdAlekseiev 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