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

Implement py-cache-decorator #738

Closed
wants to merge 3 commits into from
Closed

Conversation

SevKrok
Copy link

@SevKrok SevKrok commented Sep 29, 2023

No description provided.

Copy link

@Sel-Fisher Sel-Fisher left a comment

Choose a reason for hiding this comment

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

i like it👍

app/main.py Outdated
def wrapper(*args) -> int:
if args in cached_results:
print("Getting from cache")
else:

Choose a reason for hiding this comment

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

better try without else, use return in if instead

else:
cached_results[args] = func(*args)
print("Calculating new result")
return cached_results[args]

Choose a reason for hiding this comment

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

then here do caching and return func result

@skoval7
Copy link

skoval7 commented Sep 30, 2023

everything ok

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.

Well done 😋

@SevKrok SevKrok closed this Oct 11, 2023
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