-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Person Class #857
base: master
Are you sure you want to change the base?
Person Class #857
Conversation
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.
Please fix tests
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.
fix
Can you check? |
app/main.py
Outdated
person_instance = Person(name, age) | ||
person_list.append(person_instance) | ||
|
||
for dct in people: |
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.
dct is not a descriptive variable name
app/main.py
Outdated
for dct in people: | ||
obj = Person.people[dct.get("name")] | ||
if "wife" in dct: | ||
if dct["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.
use get() method instead of two if conditions
app/main.py
Outdated
name = person_info["name"] | ||
age = person_info["age"] | ||
person_instance = Person(name, age) | ||
person_list.append(person_instance) |
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 comprehension
app/main.py
Outdated
Person(person_info["name"], | ||
person_info["age"]) for person_info in people |
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.
Person(person_info["name"], | |
person_info["age"]) for person_info in people | |
Person(person_info["name"], person_info["age"]) | |
for person_info in people |
app/main.py
Outdated
] | ||
|
||
for person_data in people: | ||
obj = Person.people.get(person_data.get("name")) |
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.
obj
is not clear name
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.
GJ!
No description provided.