Skip to content

Tweak constraint inference against unions to exclude more unsatisfiable items #7922

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 4 commits into from
Nov 11, 2019

Conversation

ilevkivskyi
Copy link
Member

Fixes #6417

Currently constraint inference against unions excludes trivially unsatisfiable items, but a corner case of a plain type variable was missing, so I add one.

(Note: this may help with constraint inference for recursive types.)

@ilevkivskyi ilevkivskyi requested a review from JukkaL November 11, 2019 15:40
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.

Thanks, type inference bugs are often frustrating to work around. One minor comment, otherwise looks good.

@ilevkivskyi ilevkivskyi merged commit 5b73e2a into python:master Nov 11, 2019
@ilevkivskyi ilevkivskyi deleted the add-union-inference-tests branch November 11, 2019 21:47
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.

Union[Generic[T], T]] does not work as expected as a parameter in the signature of a generic function
2 participants