-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Mypy cannot infer type of [[], [1]]
#2255
Comments
Thanks for the report. It's not directly related to the a = [[], [1]]
reveal_type(a) shows that the type of You're not getting the error I think we can fix this though I'm not sure how important it is or how soon it'll happen. |
The workaround is to add an explicit type signature to
|
[[], [1]]
Since this can be worked around by adding annotations I don't consider this very urgent, and it's hard to fix (see the closed PR :-). |
Looks like the same issue as #5045 |
Duplicate of #230 |
mypy 0.4.5, CPython 3.4.4
Running the code with mypy results in an error:
This might be me misunderstanding the type system, but I would have expected mypy to ask for type annotations if it can't infer the type, e.g.:
I'm also wondering why it infers an object, when it could (should?) be a list instead.
The text was updated successfully, but these errors were encountered: