Skip to content

Commit

Permalink
FIX hooks: fix mypy for scoped_memoize
Browse files Browse the repository at this point in the history
Change-Id: I2d48ef7af5300b72cc3e190554f61681c26c9be8
  • Loading branch information
anthonyh209 committed Oct 24, 2024
1 parent e137ab2 commit d1a6f68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmk/gui/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def call(name: str, *args: Any) -> None:

def scoped_memoize(
clear_events: ClearEvents,
cache_impl: Callable[CacheWrapperArgs, Callable[P, R]],
cache_impl: Callable[CacheWrapperArgs, Callable[[Callable[P, R]], Callable[P, R]]],
cache_impl_args: CacheWrapperArgs.args,
cache_impl_kwargs: CacheWrapperArgs.kwargs,
) -> Callable[[Callable[P, R]], Callable[P, R]]:
Expand Down Expand Up @@ -155,7 +155,7 @@ def scoped_memoize(
if not clear_events:
raise ValueError(f"No clear-events specified. Use one of: {ClearEvent!r}")

def _decorator(func: P.args) -> P.args:
def _decorator(func: Callable[P, R]) -> Callable[P, R]:
cached_func = cache_impl(*cache_impl_args, **cache_impl_kwargs)(func)
for clear_event in clear_events:
# Tried to generically type this such that parameters and added methods are checked,
Expand Down

0 comments on commit d1a6f68

Please sign in to comment.