Open LeeeeT opened 1 month ago
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...
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.
Pyright hangs on the following code:
The code contains a type error on purpose.