Skip to content

Memoize decorate will remove the type hint of the original function #276

Description

@MacHu-GWU

If you put Cache.memoize on a custom function, you will lose the type hint when using that function

from diskcache import Cache

cache = Cache(directory=...)

@cache.memorize
def hello(name: str):
    return f"hello {name}"

hello(...) # when you type this, you won't see name as argument in VSCode PyCharm etc ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions