diff --git a/app/main.py b/app/main.py index 7ee7eb6a..6ae9a779 100644 --- a/app/main.py +++ b/app/main.py @@ -1,15 +1,15 @@ -from typing import Callable +from typing import Callable, Any def cache(func: Callable) -> Callable: cache_dict = {} - def wrapper(*args: Callable) -> Callable: + def wrapper(*args) -> Any: if args not in cache_dict: cache_dict[args] = func(*args) print("Calculating new result") - else: - print("Getting from cache") + return cache_dict[args] + print("Getting from cache") return cache_dict[args] return wrapper