-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: master
Are you sure you want to change the base?
Solution #1515
Conversation
There was a problem hiding this 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: |
There was a problem hiding this comment.
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.
There was a problem hiding this 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! ✨
No description provided.