suned / pfun

Functional, composable, asynchronous, type-safe Python.

Home Page:https://pfun.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

curry plugin fails with generic function argument

suned opened this issue · comments

from typing import Callable, TypeVar, Union
from pfun import curry

A = TypeVar('A')
B = TypeVar('B')


@curry
def f(v: B, g: Callable[[], A]) -> Union[B, A]:
    pass


f(1)(lambda: '')   # Argument 1 has incompatible type "Callable[[], str]"