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

New type inference: add support for upper bounds and values #15813

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

ilevkivskyi
Copy link
Member

This is a third PR in series following #15287 and #15754. This one is quite simple: I just add basic support for polymorphic inference involving type variables with upper bounds and values. A complete support would be quite complicated, and it will be a corner case to already rare situation. Finally, it is written in a way that is easy to tune in the future.

I also use this PR to add some unit tests for all three PRs so far, other two PRs only added integration tests (and I clean up existing unit tests as well).

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi
Copy link
Member Author

I have the next PR in the batch (ParamSpec support) almost ready. So I am going to merge this today or tomorrow unless there are objections.

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.

Looks good to me! Thanks for adding unit tests.

@ilevkivskyi ilevkivskyi merged commit 8c21953 into python:master Aug 9, 2023
18 checks passed
@ilevkivskyi ilevkivskyi deleted the fix-generic-inference-3 branch August 9, 2023 15:33
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