-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
featurepriority-1-normaltopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new pluginstopic-protocols
Description
I haven't been able to find another issue for this, weird that this hasn't been reported already.
from typing import *
from functools import partial
def inc(a:int) -> int:
return a+1
def foo(f: Callable[[], int]) -> int:
return f()
foo(partial(inc, 1))
This will fail with
error: Argument 1 to "foo" has incompatible type partial[int]; expected Callable[[], int]
a similar code by using a dyadic add
instead of inc
will yield:
error: Argument 1 to "foo" has incompatible type partial[int]; expected Callable[[int], int]
(so, partial apparently doesn't currently retain any type information on the non-applied inputs... I guess this'll make the fix non trivial)
toejough, michaelbarton, Jackevansevo, lambdalisue, evhub and 98 more
Metadata
Metadata
Assignees
Labels
featurepriority-1-normaltopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new pluginstopic-protocols