Skip to content

solution#2185

Open
Iondan587 wants to merge 6 commits intomate-academy:masterfrom
Iondan587:develop
Open

solution#2185
Iondan587 wants to merge 6 commits intomate-academy:masterfrom
Iondan587:develop

Conversation

@Iondan587
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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.

Review Summary

Great work on the cache decorator! Your implementation is functionally correct and meets all the core requirements of the task. The logic for storing results and managing separate caches for different functions is well done.

I'm approving your solution, but I have a couple of minor suggestions for improvement. The variable name num isn't very descriptive for a cache; a name like cache_storage would better reflect its purpose [CHECKLIST ITEM #3.1]. Additionally, there's a duplicate import of Callable that can be removed. The automated checks also flagged a few minor style issues, which are good to keep in mind for future projects. Keep up the excellent work!


✨ 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
@@ -1,6 +1,27 @@
from typing import Callable

from typing import Callable
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This line is a duplicate of the import on line 1. It's best to remove redundant imports to keep the code clean.

Comment thread app/main.py Outdated
def cache(func: Callable) -> Callable:
# Write your code here
pass
num = {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While this works, the variable name num is not very descriptive for a dictionary that stores cached results. A name like cache_storage or memo would better reflect its purpose, as suggested by checklist item #3.1 about using descriptive variable names.

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.

3 participants