suned / pfun

Functional, composable, asynchronous, type-safe Python.

Home Page:https://pfun.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add curried overload to Curry.__call__ type

suned opened this issue · comments

The current implementation of the type analyzer for Curry types and curry calls only adds the uncurried function type as the type of __call__. This means that the following call produces a false negative:

f: Curry[Callable[[int, int], int]]
g: Callable[[Callable[[int], Callable[[int], int]]], int]

g(f)

As a first solution I suggest to add an overloaded signature to Curry.__call__ that is curried in the required arguments only