Skip to content
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

Add solution #765

Closed
wants to merge 4 commits into from
Closed

Add solution #765

wants to merge 4 commits into from

Conversation

IlyaGrynyshyn
Copy link

No description provided.

Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

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

Several changes were requested.

app/main.py Outdated
pass
cache_memory = {}

def wrapper(*args) -> dict:

Choose a reason for hiding this comment

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

Change your return type annotation for wrapper, it could return Any because the function output is not known in advance.

app/main.py Outdated
pass
cache_memory = {}

def wrapper(*args) -> dict:

Choose a reason for hiding this comment

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

Consider using a decorator for wrapper from functools to preserve the wrapped function naming and docstring.

Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

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

Several changes were requested.

app/main.py Outdated
@@ -1,6 +1,17 @@
from typing import Callable
from typing import Callable, Any
import functools

Choose a reason for hiding this comment

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

import should precede from ... import, place your import in the right order.

Choose a reason for hiding this comment

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

Place your imports in the right order according to the previous comment.

app/main.py Outdated


def cache(func: Callable) -> Callable:
# Write your code here
pass
functools.wraps(func)

Choose a reason for hiding this comment

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

Place a wraps decorator at the right place as provided in the documentation.

Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

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

Several minor changes were requested.

app/main.py Outdated
@@ -1,6 +1,17 @@
from typing import Callable
from typing import Callable, Any
import functools

Choose a reason for hiding this comment

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

Place your imports in the right order according to the previous comment.

Copy link

@viktoria-rybenchuk viktoria-rybenchuk left a comment

Choose a reason for hiding this comment

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

Good job!

@IlyaGrynyshyn IlyaGrynyshyn closed this by deleting the head repository Apr 9, 2024
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