Implement Person class and create_person_list function#2870
Implement Person class and create_person_list function#2870naderidkeidek-star wants to merge 1 commit into
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The core functionality is correctly implemented—Person instances are created and stored properly, and wife/husband relationships are correctly linked as Person references. The code will produce the correct output. Regarding the specific issues raised: the type annotation errors (ANN001, ANN201, ANN204) on lines 4 and 11 are the actual blocking issues preventing the linting checks from passing. You'll need to add type hints like def __init__(self, name: str, age: int) -> None: and ensure the create_person_list function has proper annotations like people: list[dict] with an appropriate return type. The suggestions about list comprehension [CHECKLIST #3] and using dict.get() [CHECKLIST #4] are pattern recommendations rather than functional blockers—your current implementation works correctly. However, since your linter configuration requires these patterns, you may want to adopt them to avoid future linting warnings. The system test status is unrelated to your code quality and shouldn't affect your submission.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| for person_data in people: | ||
| person = Person( | ||
| person_data["name"], | ||
| person_data["age"] | ||
| ) | ||
| persons.append(person) |
There was a problem hiding this comment.
Violates checklist item #3: Use list comprehension instead of traditional for loop when creating a list of instances from a collection. Consider: persons = [Person(p['name'], p['age']) for p in people]
| for person_data in people: | ||
| person = Person.people[person_data["name"]] | ||
|
|
||
| if "wife" in person_data and person_data["wife"] is not None: |
There was a problem hiding this comment.
Violates checklist item #4: Use dict.get() method instead of explicitly checking for key presence. Replace with if person_data.get('wife'):
| if "wife" in person_data and person_data["wife"] is not None: | ||
| person.wife = Person.people[person_data["wife"]] | ||
|
|
||
| if "husband" in person_data and person_data["husband"] is not None: |
There was a problem hiding this comment.
Violates checklist item #4: Use dict.get() method instead of explicitly checking for key presence. Replace with if person_data.get('husband'):
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]
If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]
If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]
If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]
If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.
1st Try