typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Mapping tuple over a list of lists is being considered an error

Open ninjawithaneedle opened this issue 9 years ago • 1 comments

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.

ninjawithaneedle avatar Apr 19 '17 10:04 ninjawithaneedle

This looks like a bug in mypy. Filed it as https://github.com/python/mypy/issues/3193.

JukkaL avatar Apr 19 '17 12:04 JukkaL