-
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 #879
base: master
Are you sure you want to change the base?
Solution #879
Conversation
app/main.py
Outdated
for person in people: | ||
person1 = Person(person["name"], person["age"]) | ||
|
||
if "wife" in person and person["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() instead of two conditions
app/main.py
Outdated
person1.wife = Person.people[person["name"]] | ||
Person.people[person["name"]].husband = person1 | ||
|
||
if "husband" in person and person["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.
use get() instead of two conditions
README.md
Outdated
and store `name`, `age` of a person. | ||
This class also should have a class attribute | ||
`people`, it is a dict that stores `Person` | ||
instances by their `name`. Constructor should | ||
instances by their `name`. The `__init__` method should |
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.
why did you change this file?
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 didnt change that. I think it it was IDE when i set up this project. should i fix this?
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.
Yes, remove this file from the PR, please. Only app/main.py
should be present.
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.
You should rollback all changes that you have made in README.md. Your Readme must be the same as on main branch
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.
You can use git checkout -p master -- README.md
. But make sure that you are on develop
branch
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.
Several minor changes were requested.
README.md
Outdated
and store `name`, `age` of a person. | ||
This class also should have a class attribute | ||
`people`, it is a dict that stores `Person` | ||
instances by their `name`. Constructor should | ||
instances by their `name`. The `__init__` method should |
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.
Yes, remove this file from the PR, please. Only app/main.py
should be present.
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.
You should not remove the README.md
file from the repository, you should not apply any changes to it. Recreate it with the content from here and make a new commit to resolve the conflicts and run tests.
created file README.md, clicked on here and added the text. |
README.md
Outdated
and store `name`, `age` of a person. | ||
This class also should have a class attribute | ||
`people`, it is a dict that stores `Person` | ||
instances by their `name`. Constructor should | ||
instances by their `name`. The `__init__` method should |
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.
You should rollback all changes that you have made in README.md. Your Readme must be the same as on main branch
app/main.py
Outdated
# write your code here | ||
pass | ||
|
||
people_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.
In this variable first of all you should create list of Person objects, instead of doing this in regular cycle
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.
In general, looks good. Added comment for consideration.
people_list = [Person(person["name"], person["age"]) for person in people] | ||
|
||
for person in people: | ||
person1 = Person.people[person["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.
This is not another person to name it person1
, it's just an object of person. So, to name variable more specific, better to name it person_object
or smth like that.
No description provided.