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

Properly expand type in generic class with Self and TypeVar with values #14491

Merged
merged 1 commit into from
Jan 21, 2023

Conversation

ilevkivskyi
Copy link
Member

Fixes #14374

It looks like we need to special-case Self in expand_type() to support it in generics over TypeVar with values, since Self is the only type variable that can legitimately have other type variables in its upper bound.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

Good to have this fixed in 1.0!

@JukkaL JukkaL merged commit cc1bcc9 into python:master Jan 21, 2023
@ilevkivskyi ilevkivskyi deleted the fix-self-values branch January 21, 2023 18:01
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.

TypeVar with values has incompatible type when used Self
2 participants