Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ class _HasKwargs:
pass


def memoize_on_first_arg(function, cache_dict_name=None):
def memoize_on_first_arg(function: F, cache_dict_name: str = None) -> F:
"""Like :func:`memoize_method`, but for functions that take the object
in which do memoization information is stored as first argument.

Expand Down Expand Up @@ -716,9 +716,9 @@ def clear_cache(obj):

from functools import update_wrapper
new_wrapper = update_wrapper(wrapper, function)
new_wrapper.clear_cache = clear_cache
new_wrapper.clear_cache = clear_cache # type: ignore[attr-defined]

return new_wrapper
return new_wrapper # type: ignore[return-value]


def memoize_method(method: F) -> F:
Expand Down