Skip to content

Commit

Permalink
fix else and add type annotation Any
Browse files Browse the repository at this point in the history
  • Loading branch information
DenPrislipskyi committed Sep 30, 2023
1 parent ea3930a commit f6f87c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f6f87c4

Please sign in to comment.