Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message for dict literal #304

Closed
JukkaL opened this issue Jul 18, 2014 · 1 comment · Fixed by #3100
Closed

Confusing error message for dict literal #304

JukkaL opened this issue Jul 18, 2014 · 1 comment · Fixed by #3100
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 18, 2014

I type checked this code:

from typing import Undefined, Dict
x = Undefined(Dict[int, str])
x = {'x': 1}

I got this error message:

x.py, line 3: List item 1 has incompatible type "Tuple[str, int]"

This is confusing since I'm not creating a list and I'm not using tuples.

@JukkaL JukkaL added bug and removed front end labels Jul 18, 2014
@gvanrossum
Copy link
Member

This issue still exists; the example is now:

from typing import Dict
x = None  # type: Dict[int, str]
x = {'x': 1}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants