Skip to content

solution#2263

Open
arlanneresdossantos-sketch wants to merge 2 commits into
mate-academy:masterfrom
arlanneresdossantos-sketch:develop
Open

solution#2263
arlanneresdossantos-sketch wants to merge 2 commits into
mate-academy:masterfrom
arlanneresdossantos-sketch:develop

Conversation

@arlanneresdossantos-sketch
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

Your cache decorator implementation is functionally correct and meets all core requirements. However, there's a linting issue that must be fixed before the task can be approved. In app/main.py line 10, column 36, there's a missing whitespace around an operator (E225 error: missing whitespace around operator). Add spaces around the operator to fix this. Additionally, per checklist item #2 (Code Style), consider changing single quotes to double quotes in your print statements on lines 14 and 17. The core functionality is solid, so these are quick fixes to get everything passing.


✨ 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
cache_key = (args, tuple(sorted(kwargs.items())))

if cache_key in stored_results:
print("Getting from cache")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #2 (Code Style) violation: Use double quotes as the preferred quote style. The print statements on lines 14 and 17 use single quotes.

Comment thread app/main.py
print("Getting from cache")
return stored_results[cache_key]
else:
print("Calculating new result")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #2 (Code Style) violation: Use double quotes as the preferred quote style.

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

Your cache decorator implementation is approved. The code correctly implements all required functionality: storing function results in a cache dictionary, returning cached results for repeated arguments (printing "Getting from cache"), and calculating new results for new arguments (printing "Calculating new result"). The implementation properly handles variable arguments using *args, **kwargs and each decorated function maintains its own independent cache via closure. All style requirements are met with descriptive variable names and double-quote strings. Your solution is ready to use.


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

Footnotes

  1. Rate AI review example

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