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
When I run mypy==1.12.0 on the example below, I get following errors:
mypy==1.12.0
testtyping.py:12: error: Returning Any from function declared to return "int" [no-any-return] testtyping.py:12: error: No overload variant of "__get__" of "LRUAsyncCallable" matches argument types "A", "type[A]" [call-overload] testtyping.py:12: note: Possible overload variant: testtyping.py:12: note: def __get__(self, instance: None, owner: type | None = ...) -> LRUAsyncCallable[Callable[[A, int], Coroutine[Any, Any, int]]]
Without the @cache decorator, there are no mypy errors. I'd expect the decorator to preserve the method annotation.
@cache
from asyncstdlib import cache class A: @cache async def func(self, x: int) -> int: return x + 1 async def my_func(self) -> int: return await self.func(5)
The text was updated successfully, but these errors were encountered:
This looks like a recent regression. Things are working fine with MyPy 1.10 and 1.11. I have to double check whether it's an issue on the MyPy side.
Sorry, something went wrong.
The MyPy folks were very quick to fix this. This should be resolved with the next MyPy release.
Looks good :-). Thanks for your attention.
No branches or pull requests
What happened?
When I run
mypy==1.12.0
on the example below, I get following errors:Without the
@cache
decorator, there are no mypy errors. I'd expect the decorator to preserve the method annotation.Minimal Reproducible Example
Request Assignment [Optional]
The text was updated successfully, but these errors were encountered: