Skip to content

Solution#2250

Open
ya-ira wants to merge 1 commit into
mate-academy:masterfrom
ya-ira:develop
Open

Solution#2250
ya-ira wants to merge 1 commit into
mate-academy:masterfrom
ya-ira:develop

Conversation

@ya-ira
Copy link
Copy Markdown

@ya-ira ya-ira commented May 26, 2026

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 solid and meets all core functional requirements. Caching works correctly with variable arguments, maintains separate caches per function, returns cached results for repeated calls, and properly prints the required messages. The return type annotation -> int on the wrapper function is a minor type-checking concern rather than a functional blocker. While the code runs correctly at runtime (Python doesn't enforce type hints), this annotation could cause static type checkers like mypy to flag errors if the decorated function returns a different type like a list. Consider either removing the annotation or using -> Any from the typing module if you want to keep the decorator's type hints accurate. Overall, the implementation is clean, efficient, and production-ready for the task requirements. Great work!


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

Footnotes

  1. Rate AI review example

Comment thread app/main.py
# Write your code here
pass
@wraps(func)
def wrapper_cache(*args) -> int:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The return type annotation -> int is incorrect. Since the decorator should work with any function (e.g., functions returning lists as shown in the example), the wrapper's return type should be more generic or omitted.

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