Skip to content

Commit

Permalink
'Solution'
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYOSHl committed Nov 30, 2024
1 parent e57c7e0 commit 16ed7b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from typing import Callable, Dict, Tuple
from typing import Callable, Dict, Tuple, Any


def cache(func: Callable) -> Callable:
cache_store: Dict[Tuple, any] = {}
cache_store: Dict[Tuple, Any] = {}


def wrapper(*args):
def wrapper(*args) -> Any:
if args in cache_store:
print("Getting from cache")
return cache_store[args]
Expand All @@ -14,4 +13,5 @@ def wrapper(*args):
result = func(*args)
cache_store[args] = result
return result
return wrapper()

return wrapper

0 comments on commit 16ed7b8

Please sign in to comment.