Skip to content
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

py-person-class solution #1605

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SummerKatrin
Copy link

No description provided.

Copy link

@Bleit1 Bleit1 left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link

@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.


Thank you for your hard work on this code! 😊 There are a few critical issues that need to be addressed before we can approve the pull request:

  1. Undefined Attributes: The code attempts to assign husband and wife attributes to Person objects, but these attributes are not defined in the Person class. Please define these attributes if you intend to use them.

  2. Class Attribute Access: The line self.people[name] = self will raise an error because self.people is trying to access an instance attribute that doesn't exist. You should use Person.people[name] = self to correctly access the class attribute.

  3. Shared Class Attribute: The people dictionary is defined as a class attribute, meaning it is shared across all instances of the Person class. If this is intentional, ensure that you handle it carefully to avoid unexpected behavior.

Once these issues are resolved, the code will be in great shape! Keep up the good work, and feel free to reach out if you need any help. 🚀

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

app/main.py Show resolved Hide resolved
app/main.py Outdated Show resolved Hide resolved
app/main.py Show resolved Hide resolved
Copy link

@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

Great job on implementing the Person class and the create_person_list function! 🎉 Your code meets the task requirements and constraints, which is a significant achievement. However, there are a few critical issues that need attention:

  1. Undefined Attributes: The code attempts to assign husband and wife attributes to Person objects, but these attributes are not defined in the Person class. Make sure to define these attributes within the class to avoid potential attribute errors.

  2. Shared Class Attribute: The people dictionary is a class attribute shared across all instances. Ensure this is intentional and manage it carefully to prevent unintended side effects.

  3. Code Improvement: While checking for keys in dictionaries, consider using the dict.get() method for cleaner and more efficient code.

Overall, your solution is on the right track, and the decision to approve is made to help you move forward with your learning. Please review the comments and address the issues mentioned to enhance your code quality. Keep up the good work and continue learning from these experiences! 💪

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

Comment on lines +19 to +23
Person.people[person_raw["name"]].husband \
= Person.people[person_raw["husband"]]
if "wife" in person_raw.keys() and person_raw["wife"]:
Person.people[person_raw["name"]].wife \
= Person.people[person_raw["wife"]]

Choose a reason for hiding this comment

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

The code attempts to assign husband and wife attributes to Person objects, but these attributes are not defined in the Person class. You need to define these attributes within the Person class to avoid attribute errors.

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.

3 participants