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

Never put None in TupleType items #4051

Merged
merged 3 commits into from Oct 3, 2017

Conversation

Projects
None yet
4 participants
@ilevkivskyi
Collaborator

ilevkivskyi commented Oct 3, 2017

Fixes #4046

The root cause for the crash is that None was put in TupleType items if the corresponding lvalue is a definition. Then the crash happens when this TupleType is used as a context for rvalue type inference. The solution is to put UninhabitedType in such cases, so that inference will fall back on using argument types instead.

This PR should not cause any crashes but it makes sense to test it against internal codebases since it touches an area that might alter type inference in corner cases.

Ivan Levkivskyi added some commits Oct 3, 2017

Ivan Levkivskyi
Ivan Levkivskyi
Ivan Levkivskyi
@ethanhs

ethanhs approved these changes Oct 3, 2017

Fix looks good to me as long as it works for @ambv / @carljm.

@gvanrossum gvanrossum merged commit d23fc47 into python:master Oct 3, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gvanrossum

This comment has been minimized.

Show comment
Hide comment
@gvanrossum

gvanrossum Oct 3, 2017

Member

I checked our internal codebase and everything's fine. Thanks for the quick fix! I'll ponder it a little bit and then probably cherry-pick.

Member

gvanrossum commented Oct 3, 2017

I checked our internal codebase and everything's fine. Thanks for the quick fix! I'll ponder it a little bit and then probably cherry-pick.

@gvanrossum gvanrossum referenced this pull request Oct 3, 2017

Closed

Release 0.530 planning #4009

5 of 5 tasks complete
@carljm

This comment has been minimized.

Show comment
Hide comment
@carljm

carljm Oct 3, 2017

Contributor

This fixes the issue for us as well. Thanks @ilevkivskyi!

Contributor

carljm commented Oct 3, 2017

This fixes the issue for us as well. Thanks @ilevkivskyi!

@ilevkivskyi ilevkivskyi deleted the ilevkivskyi:fix-nested-tuples branch Oct 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment