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
Pyright hangs on the following code:
from collections.abc import Callable from typing import Protocol class MyProto(Protocol): def __call__[A, B](self, a: Callable[[A], B], b: Callable[[Callable[[A], B]], A]) -> B: ... p: MyProto = lambda a: lambda b: a(b)
The code contains a type error on purpose.
The text was updated successfully, but these errors were encountered:
If I fix the type error in the implementation...
p: MyProto = lambda a, b: a(b(a))
...pyright correctly shows no errors.
But if I then curry both the protocol and the implementation using my favorite ✨ curry 💅 function...
curry
def curry[First, *Rest, Result](function: Callable[[First, *Rest], Result]) -> Callable[[*Rest], Callable[[First], Result]]: return lambda *rest: lambda first: function(first, *rest) class MyProto(Protocol): @curry def __call__[A, B](self, a: Callable[[A], B], b: Callable[[Callable[[A], B]], A]) -> B: ... p: MyProto = curry(lambda a, b: a(b(a)))
...pyright, again, hangs.
Sorry, something went wrong.
No branches or pull requests
Pyright hangs on the following code:
The code contains a type error on purpose.
The text was updated successfully, but these errors were encountered: