Closed
Description
From python/typeshed#1178:
map(tuple, [ [2, 3] ])
throws
error: Argument 1 to "map" has incompatible type Tuple[_T_co, ...]; expected Callable[[List[int]], Tuple[_T_co, ...]]
However, this is valid python code.
Here's a more self-contained example that reproduces the problem:
from typing import Callable, TypeVar
T = TypeVar('T')
S = TypeVar('S')
def f(fn: Callable[[T], S], x: T) -> None: pass
def g(x: T) -> T: pass
f(g, 1) # Argument 1 to "f" has incompatible type Callable[[T], T]; expected Callable[[int], T]