-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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' #1333
base: master
Are you sure you want to change the base?
'Solution' #1333
Conversation
app/main.py
Outdated
else: | ||
print("Calculating new result") | ||
cache_dict[key] = func(*args, **kwargs) | ||
return cache_dict[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better not to use the “else” method here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, return cache_dict[key] once at the end of the function to avoid calling return twice
app/main.py
Outdated
else: | ||
print("Calculating new result") | ||
cache_dict[key] = func(*args, **kwargs) | ||
return cache_dict[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, return cache_dict[key] once at the end of the function to avoid calling return twice
Co-authored-by: Nataliia Zakharchuk <[email protected]>
No description provided.