We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using cached does not preserve the type signature.
cached
from memoization import cached import inspect def foo(a: str) -> int: return int(a) def bar(a: str) -> int: return int(a) @cached def baz(a: str) -> int: return int(a) assert inspect.getfullargspec(foo) == inspect.getfullargspec(bar), "foo != bar" assert inspect.getfullargspec(foo) == inspect.getfullargspec(baz), "foo != baz"
Expected: No output
Actual result:
Traceback (most recent call last): File "<stdin>", line 1, in <module> AssertionError: foo != baz
This prevents using type validation tools, such as mypy, from being used to validate the usage of methods wrapped in cached.
The text was updated successfully, but these errors were encountered:
add typing stub file given #16
0d6b5c0
full support for static type checking (#16)
05d2720
247a53f
Resolved in v0.3.2. Now available at PyPI or GitHub Releases.
I also added full support for static type checking and it should work fine with validation tools. Thanks for the issue and your interest in this work.
Sorry, something went wrong.
No branches or pull requests
Using
cached
does not preserve the type signature.Expected: No output
Actual result:
This prevents using type validation tools, such as mypy, from being used to validate the usage of methods wrapped in
cached
.The text was updated successfully, but these errors were encountered: