Skip to content

Bug (?) with Sequence / List #1113

Closed
Closed
@rmcgibbo

Description

@rmcgibbo

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions