You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memoize decorate will remove the type hint of the original function #276
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 ...
Using diskcache-stubs solves this problem.
I have confirmed that it works for pyright,
For mypy, I have confirmed that it works in the latest commit (which will be deployed in a new release soon).
Activity
MacHu-GWU commentedon Apr 8, 2023
@grantjenks thank you for the great work!
I found an issue and also send a PR to fix it. Wish I could contribute a little
#277
grantjenks commentedon Apr 8, 2023
Let’s discuss in the PR.
phi-friday commentedon May 16, 2024
Using
diskcache-stubssolves this problem.I have confirmed that it works for
pyright,For
mypy, I have confirmed that it works in the latest commit (which will be deployed in a new release soon).arg types
__cache_key__