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

Fix missing builtin aliases on Python 2 (and other versions) #6441

Merged
merged 4 commits into from Feb 21, 2019

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Feb 20, 2019

Some builtin aliases (like typing.ChainMap) are not available on some Python versions, or in some fixtures. However, if while they were first looked up while target namespace was incomplete, we put a PlaceholderNode in typing. This PR either doesn't put or removes this placeholder node if we didn't find the target after the target namespace is complete.

I didn't find a way to test this (since we don't have incremental pythoneval tests), but I double-checked this fixes the crash with actual Python 2 stubs.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this a good way to fix this issue.

mypy/newsemanal/semanal.py Show resolved Hide resolved
@ilevkivskyi ilevkivskyi merged commit bd6af1c into python:master Feb 21, 2019
@ilevkivskyi ilevkivskyi deleted the new-fix-builtin-aliases-2 branch February 21, 2019 21:48
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.

None yet

2 participants