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

correct test-maim-py in py-mutable-immutable #2134

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

Conversation

Just-Kexit
Copy link

No description provided.

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 effort on this task! However, there are a few critical issues that need to be addressed before we can proceed.

  1. Incorrect Categorization of Variables: The main issue lies in the categorization of variables into 'mutable' and 'immutable'. Lists are mutable, while tuples and dictionaries are considered immutable in this context. Please ensure that variables like my_favourite_films (a list) are categorized as mutable, and variables like profile_info (a tuple) and marks (a dictionary) are categorized as immutable.

  2. Logical Error in Tests: The test_variables_added_to_the_correct_list function has a logical error. The is_immutable function should return True for immutable objects, and the test should reflect this logic correctly. Please adjust the test to ensure it accurately verifies the categorization of variables.

Once these issues are resolved, your code will be in great shape! Keep up the good work, and don't hesitate to reach out if you need further clarification or assistance. 😊

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

Comment on lines 85 to 87
assert is_immutable(variable) is True, (
f"{variable} should be in 'immutable' list"
)

Choose a reason for hiding this comment

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

The logic here is incorrect. The is_immutable function returns True for immutable objects, but the test expects True for mutable objects. You should change is_immutable(variable) is True to is_immutable(variable) is False to correctly test that mutable variables are in the 'mutable' list.

Comment on lines 90 to 92
assert is_immutable(variable) is False, (
f"{variable} should be in 'mutable' list"
)

Choose a reason for hiding this comment

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

The logic here is incorrect. The is_immutable function returns True for immutable objects, but the test expects False for immutable objects. You should change is_immutable(variable) is False to is_immutable(variable) is True to correctly test that immutable variables are in the 'immutable' list.

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 effort on your submission! 🎉 However, there are a few critical issues that need to be addressed to ensure your code meets the task requirements:

  1. Incorrect Categorization of Variables:

    • my_favourite_films (a list) and marks (a dictionary) are mutable and should be categorized as such.
    • profile_info (a tuple) is immutable and should be categorized as immutable.
    • collection_of_coins (a set) is mutable and should be categorized as mutable.
  2. Missing Test Functions: Ensure that you include test functions like test_variables_added_to_the_correct_list to verify the correct categorization of variables. This will help in validating your logic and ensuring that the is_immutable function works as expected.

While the decision is to APPROVE this Pull Request to help you move forward with your learning, please make sure to review the comments and improve your code accordingly. Addressing these issues will not only enhance your understanding but also prevent similar problems in the future. Keep up the good work and continue learning from your mistakes! 🚀

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

Comment on lines +20 to +21
"mutable": [my_favourite_films, collection_of_coins, marks],
"immutable": [lucky_number, pi, one_is_a_prime_number, name, profile_info]

Choose a reason for hiding this comment

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

The categorization of variables is incorrect. my_favourite_films (a list) and marks (a dictionary) should be in the 'mutable' category, while profile_info (a tuple) and collection_of_coins (a set) should be in the 'immutable' category.

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