Skip to content

Add missing imports from typing #933

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

Merged
merged 1 commit into from
Feb 14, 2017

Conversation

ilevkivskyi
Copy link
Member

Dict, List, and Set were not imported from typing. Mypy didn't notice this because of python/mypy#999

Here I fix this by adding missing imports and will make a PR to mypy soon.

@gvanrossum gvanrossum merged commit 22c0353 into python:master Feb 14, 2017
@gvanrossum
Copy link
Member

Thanks! How did you discover this?

@ilevkivskyi
Copy link
Member Author

ilevkivskyi commented Feb 14, 2017

Thanks for quick merge!

Here is mypy PR python/mypy#2863 I will rebase it after next "sync typeshed". The problem is that these errors become runtime errors if you turn them from type comments to variable annotations, I discovered this some time ago. The fix is very simple, see mypy PR.

@ilevkivskyi ilevkivskyi deleted the no-import-list branch February 14, 2017 19:07
gvanrossum pushed a commit to python/mypy that referenced this pull request Feb 14, 2017
Fix #999

This is a straightforward fix: List, Set, and Dict are treated as aliases to their builtins counterparts, therefore they are ignored by remove_imported_names_from_symtable, I fix this by also removing the alias names.

The fix also revealed few places in mypy where imports were missing, and one bug in fastparse.py. Those have been fixed.

The fix also includes a typeshed sync at  python/typeshed#933.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants