Skip to content

Solution is added#2863

Open
RinBd wants to merge 2 commits into
mate-academy:masterfrom
RinBd:develop
Open

Solution is added#2863
RinBd wants to merge 2 commits into
mate-academy:masterfrom
RinBd:develop

Conversation

@RinBd
Copy link
Copy Markdown

@RinBd RinBd commented May 30, 2026

No description provided.

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

All core requirements are met: the Person class correctly stores instances in a class attribute, create_person_list properly instantiates Person objects and links spouse relationships. The code functions correctly for the specified inputs. Regarding the feedback, the main point to address is [CHECKLIST ITEM #3]: the first loop in create_person_list should use a list comprehension instead of a traditional for loop when creating Person instances. This is a straightforward refactor - you can create the list with a comprehension first, then handle spouse linking in a second pass. The variable name objects could also be more descriptive per [CHECKLIST ITEM #1], something like person_dict or person_data would be clearer. These are style improvements rather than functional issues, so your code is ready to use as-is.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread app/main.py Outdated
Comment on lines +11 to +18
list_of_objects = []
for person_dict in people:
person = Person(person_dict["name"], person_dict["age"])
if person_dict.get("wife") is not None:
person.wife = person_dict.get("wife")
if person_dict.get("husband") is not None:
person.husband = person_dict.get("husband")
list_of_objects.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.

Use list comprehension instead of traditional for loop when creating Person instances, as required by checklist item #3.

Comment thread app/main.py Outdated
if person_dict.get("husband") is not None:
person.husband = person_dict.get("husband")
list_of_objects.append(person)
for objects in list_of_objects:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 recommends descriptive variable names. Consider renaming objects to something more descriptive like person.

@RinBd
Copy link
Copy Markdown
Author

RinBd commented May 30, 2026

According to the AI review (checklist item #1) variable names are changed.

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