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 #1515

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

Solution #1515

wants to merge 2 commits into from

Conversation

betterthink
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 hard work on this task! 😊 It looks like you're almost there, but there's a critical issue that needs to be addressed before we can approve your pull request. The wrapper function in your cache decorator is currently set to return None, which prevents the caching mechanism from functioning correctly. Please update the return type to match the result of the cached function call, or remove the return type hint to allow it to return any type. Once this is fixed, your solution will meet all the task requirements. Keep up the great work, and I look forward to seeing your updated code! 🚀

✨ 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
pass
cache_dic = {}

def wrapper(*args) -> None:

Choose a reason for hiding this comment

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

The wrapper function is defined to return None, but it should return the result of the function call. Change the return type from None to the appropriate type, or remove the return type hint to allow it to return any type.

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.

Your implementation of the cache decorator function is correct and effectively addresses the previous issue with the return type. The wrapper function now properly returns the result of the cached function call, ensuring the caching mechanism operates as intended. Your code meets the task requirements and constraints, correctly storing results of completed runs with different arguments, handling multiple decorated functions, and printing appropriate messages.

While the decision is to APPROVE to help you move forward with your learning, please review the comments to further improve your code. If there are any issues, especially critical ones, make sure to address them in future projects to enhance your coding skills. Keep up the good work and continue learning from your experiences! 🚀

✨ 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