Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuliia Hladyshkevych committed Oct 1, 2023
1 parent 2d8d529 commit 0ffcc95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ def cache(func: Callable) -> Callable:
def wrapper(*args) -> Any:
if args in cache_dict:
print("Getting from cache")
return cache_dict[args]
else:
cache_dict[args] = func(*args)
print("Calculating new result")
return cache_dict[args]
cache_dict[args] = func(*args)
return cache_dict[args]
return wrapper

0 comments on commit 0ffcc95

Please sign in to comment.