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

Solution #1438

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

Solution #1438

wants to merge 4 commits into from

Conversation

BlackYOSHl
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 efforts on this Pull Request! 😊 However, there are a few critical issues that need to be addressed before we can approve it:

  1. Decorator Return Value: The cache decorator currently returns wrapper() instead of wrapper. This means the function is executed immediately rather than being returned as a callable, which is not the intended behavior. Please change return wrapper() to return wrapper to fix this issue.

  2. Handling of Mutable Arguments: The task specifies that the decorator should be used only with functions that have immutable arguments. While this isn't explicitly enforced in your code, it's important to ensure that users of the decorator are aware of this constraint to prevent unexpected behavior.

  3. Code Style and Cleanliness: While not critical, following Python's PEP 8 style guide will improve readability. Consider reviewing your code for unnecessary blank lines or inconsistent formatting.

Once these issues are addressed, your code will be much stronger and ready for approval. Keep up the great work, and don't hesitate to reach out if you have any questions! 🚀

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

Great job on implementing the cache decorator! 🎉 Your code meets the task requirements and constraints, ensuring that results are cached and retrieved correctly. The handling of immutable arguments is well-implemented, and the code style is clean and consistent.

However, there are a few critical issues to address in the future:

  1. Decorator Return Value: Ensure that the wrapper function is returned correctly. It's good to see this has been improved from previous reviews.

  2. Handling of Mutable Arguments: Your code correctly raises a ValueError for mutable arguments, which is crucial for maintaining the integrity of the cache.

Overall, your solution is correct and ready for use. Keep up the good work, and make sure to review the comments to further improve your code. Addressing these issues will help you avoid similar problems in the future and enhance your learning experience. Keep pushing forward! 🚀

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

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