Skip to content

Implement Person class and create_person_list function#2870

Open
naderidkeidek-star wants to merge 1 commit into
mate-academy:masterfrom
naderidkeidek-star:master
Open

Implement Person class and create_person_list function#2870
naderidkeidek-star wants to merge 1 commit into
mate-academy:masterfrom
naderidkeidek-star:master

Conversation

@naderidkeidek-star
Copy link
Copy Markdown

1st Try

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread app/main.py
Comment on lines +17 to +22
for person_data in people:
person = Person(
person_data["name"],
person_data["age"]
)
persons.append(person)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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]

Comment thread app/main.py
for person_data in people:
person = Person.people[person_data["name"]]

if "wife" in person_data and person_data["wife"] is not None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Violates checklist item #4: Use dict.get() method instead of explicitly checking for key presence. Replace with if person_data.get('wife'):

Comment thread app/main.py
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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Violates checklist item #4: Use dict.get() method instead of explicitly checking for key presence. Replace with if person_data.get('husband'):

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

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.

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