Skip to content

Commit

Permalink
fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Darya-Savchenko committed Dec 11, 2024
1 parent 4ae5583 commit c900dea
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Callable
from typing import Callable, Tuple, List
from functools import wraps


def cache(func: Callable) -> Callable:
cache_store = {}

@wraps(func)
def wrapper(*args):
def wrapper(*args) -> Callable:
key = tuple(args)
if key in cache_store:
print("Getting from cache")
Expand All @@ -21,11 +21,10 @@ def wrapper(*args):


@cache
def long_time_func(a: int, b: int, c: int) -> int:
return (a ** b ** c) % (a * c)
def long_time_func(base: int, exponent1: int, exponent2: int) -> int:
return (base ** exponent1 ** exponent2) % (base * exponent2)


@cache
def long_time_func_2(n_tuple: tuple, power: int) -> int:
return [number ** power for number in n_tuple]

def long_time_func_2(number_tuple: Tuple[int, ...], power: int) -> List[int]:
return [number ** power for number in number_tuple]

0 comments on commit c900dea

Please sign in to comment.