Currently, curry instances returned from decorating methods with curry doesn't eliminate the self argument, which issues a type error when trying to call a curried method:
from pfun import curry
class C:
@curry
def f(x: int, y: int) -> int: ...
reveal_type(C().f) # note: Revealed type is 'pfun.functions.Curry[def (self: test_types.C, x: builtins.int, y: builtins.int) -> builtins.int]'
C().f(1) # error: Argument 1 to "__call__" of "Curry" has incompatible type "int"; expected "C"
The main issue in fixing this is finding a way to distinguish this call to curry with a call with an instance that has a __call__ method in e.g:
Currently, curry instances returned from decorating methods with
curry
doesn't eliminate theself
argument, which issues a type error when trying to call a curried method:The main issue in fixing this is finding a way to distinguish this call to curry with a call with an instance that has a
__call__
method in e.g: