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

Solution #746

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Solution #746

wants to merge 3 commits into from

Conversation

MiskoRuslan
Copy link

I feel a little problem on the seventh line :))
But let`s try

app/main.py Outdated
pass
cache_dict = {}

def inner(*args: tuple) -> [list, int]:

Choose a reason for hiding this comment

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

Yes, inner can return not only these types, it's better to use Any

app/main.py Outdated
pass
cache_dict = {}

def inner(*args: tuple) -> [list, int]:

Choose a reason for hiding this comment

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

No need to add type annotations to *args. You can use, for example, *args: int if you want to indicate that func expects integer arguments

Fix not correct type anotation
app/main.py Outdated
if args not in cache_dict:
cache_dict[args] = func(*args)
print("Calculating new result")
return cache_dict[args]
Copy link

Choose a reason for hiding this comment

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

try to rewrite your decorator not to have return duplicated

use only one 'return'
Copy link

@LiudmylaKulinchenko LiudmylaKulinchenko left a comment

Choose a reason for hiding this comment

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

Nice work! 🎈

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.

5 participants