-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
E.g
from typing import TypeVar
from pfun import compose
A = TypeVar('A')
def f(a: A) -> A:
pass
def g(a: int) -> str:
pass
compose(f, g) # error: Cannot infer argument 1 of composeI think this is a current limitation of the mypy inference, since this also does not work:
R1 = TypeVar('R1')
R2 = TypeVar('R2')
R3 = TypeVar('R3')
def compose(f: Callable[[R2], R1], g: Callable[[R3], R2]) -> Callable[[R3], R1]:
pass
A = TypeVar('A')
def f(a: A) -> A:
pass
def g(a: int) -> str:
pass
compose(f, g) # error: Cannot infer type of argument 1 of compose