Skip to content

Don't truncate Tuple, Union, and generic types in error messages #287

@gvanrossum

Description

@gvanrossum

This gives the expected error::

from typing import List, Tuple
x = [
    ('', [''], 0),
    ]  # type: List[Tuple[str, List[str], str]]

Error::

z.py, line 2: List item 1 has incompatible type "Tuple[str, List[str], str]"

But this shortens the type to just 'tuple'::

from typing import List, Tuple
x = [
    ('', '', [''], 0),
    ]  # type: List[Tuple[str, str, List[str], str]]

Error::

z.py, line 2: List item 1 has incompatible type tuple

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions