Closed
Description
This is from the latest master (pip install git+git://github.com/JukkaL/mypy.git
).
$ cat file.py
from typing import Dict, Sequence
def f(data: Dict[str, Sequence[int]]) -> None:
pass
data = {"a": [1, 2]}
f(data)
$ mypy file.py
file.py:7: error: Argument 1 to "f" has incompatible type Dict[str, List[int]]; expected Dict[str, Sequence[int]]
If I replace the function call with f({"a": [1, 2]})
, instead of defining the dict on a separate line, then it works.
Metadata
Metadata
Assignees
Labels
No labels