Skip to content

Create dict mutable and immutable, add type#3585

Open
slavtvin wants to merge 3 commits into
mate-academy:masterfrom
slavtvin:master
Open

Create dict mutable and immutable, add type#3585
slavtvin wants to merge 3 commits into
mate-academy:masterfrom
slavtvin:master

Conversation

@slavtvin

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there is one behavioral issue that can break automated tests, even though your core solution is otherwise correct. You correctly created the sorted_variables dictionary with the required keys ("mutable" and "immutable") and classified all 8 variables into the right groups, satisfying the main functional requirements [CHECKLIST ITEM #1–3, #5–6]. However, at the end of app/main.py you call print(sorted_variables), which introduces side-effect output that is not part of the task description and can cause import-based tests to fail unexpectedly. To fix this, remove the print(sorted_variables) line so the module only defines the dictionary without producing output when imported. Aside from this extra print, your approach and mutability classification are solid, so once that side effect is removed your solution should fully meet the task requirements.


✨ 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 Outdated
else:
sorted_variables["immutable"].append(collection_of_coins)

print(sorted_variables) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task only requires you to create the sorted_variables dictionary; printing it is not part of the specification and can cause automated tests (which usually only import this module) to fail due to unexpected output. Consider removing this print call.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am approving your solution because it fully meets the functional and structural requirements of the task. Your sorted_variables dictionary is correctly defined with the exact keys "mutable" and "immutable", and all 8 variables are included exactly once and correctly grouped by mutability. There are no side effects at import time (such as print calls), so the module behaves cleanly when imported, which aligns with the task expectations.

The remaining issue identified in the check logs is a linting/style concern (using type(x) == list instead of isinstance(x, list) on several lines), which does not break functionality or violate the core task requirements. You should still address these E721 lint warnings by replacing type(variable) == SomeType with isinstance(variable, SomeType) to satisfy flake8 and follow Python best practices, but this is a quality improvement rather than a blocker. Overall, your implementation is correct and complete—nice work getting everything in place accurately.


✨ 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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved because it fully meets the task requirements and cleanly classifies all eight variables into sorted_variables by mutability. The module-level variables cover the required data types (lists, dict, set, int, float, bool, string, tuple), and each appears exactly once in either the "mutable" or "immutable" list, which aligns with items like [CHECKLIST ITEM #1], [CHECKLIST ITEM #5], and [CHECKLIST ITEM #7]. Using isinstance instead of direct type(...) == ... checks is a good, Pythonic choice and shows attention to style and robustness. The sorted_variables dictionary is well-structured with exactly the keys "mutable" and "immutable", and it stores the actual variable objects, not just their names, matching [CHECKLIST ITEM #3], [CHECKLIST ITEM #4], and [CHECKLIST ITEM #10]. There are no critical or medium issues to address; the code is straightforward, readable, and free of unnecessary side effects. Nice work applying previous feedback and arriving at a clean, idiomatic solution—this is a solid example of organizing data by behavior (mutability) in Python.


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

Footnotes

  1. Rate AI review example

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