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
I've been struggling with this one, and I'm not sure if I'm doing something wrong or mypy is doing something wrong:
from typing import Callable, Generic, ParamSpec, TypeVar P = ParamSpec("P") R = TypeVar("R") class A(Generic[P, R]): def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: ... def decorator(fn: Callable[P, R]) -> A[P, R]: ... class B: @decorator def foo(self) -> None: ... b = B() b.foo() # error: Missing positional argument "self" in call to "__call__" of "A" [call-arg]
I need the decorator, which returns the A wrapper, to work with both functions and methods.
A
Full project is at: aio-libs/async-lru#508
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've been struggling with this one, and I'm not sure if I'm doing something wrong or mypy is doing something wrong:
I need the decorator, which returns the
A
wrapper, to work with both functions and methods.Full project is at: aio-libs/async-lru#508
The text was updated successfully, but these errors were encountered: