-
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
Done! #1470
base: master
Are you sure you want to change the base?
Done! #1470
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.
Great job on implementing the cache
decorator! 🎉 Your code meets the task requirements and constraints, effectively storing and retrieving results as needed. While there are a couple of minor issues, such as using mutable types as dictionary keys and the wrapper
function returning None
, these don't significantly impact the functionality. Keep up the good work, and consider addressing these points to enhance your code further! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
app/main.py
Outdated
pass | ||
cache_storage = {} | ||
|
||
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 currently 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 type hint if it's not necessary.
cache_storage = {} | ||
|
||
def wrapper(*args) -> None: | ||
if args in cache_storage: |
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.
Using mutable types (like lists) as dictionary keys can lead to errors because they are not hashable. Ensure that the arguments used as keys in cache_storage
are immutable (e.g., tuples).
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.
LGMT!
No description provided.