Skip to content

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 7, 2025

This a WIP to see the test result before adding my own tests :)

Closes #20020

@sobolevn sobolevn force-pushed the wip-typevar-defaults branch from b3a64cd to 083ffca Compare October 7, 2025 21:22

This comment has been minimized.

@sobolevn sobolevn marked this pull request as ready for review October 7, 2025 21:41
@sobolevn sobolevn requested a review from ilevkivskyi October 7, 2025 21:42
@sobolevn
Copy link
Member Author

sobolevn commented Oct 7, 2025

@ilevkivskyi this fix reveals another bug (I believe that it is a separate one?). X'1 must not be revealed as a1.z type. I will open a new issue about it once this is done.

This comment has been minimized.

Copy link
Collaborator

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

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

Makes sense to me, though this is a false positive not a false negative!

@sobolevn sobolevn changed the title Fix [name-defined] false-negative in class A[X, Y=X]: case Fix [name-defined] false-positive in class A[X, Y=X]: case Oct 8, 2025
Copy link
Contributor

github-actions bot commented Oct 8, 2025

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

@sobolevn sobolevn merged commit 77b4cfb into master Oct 8, 2025
20 checks passed
@sobolevn sobolevn deleted the wip-typevar-defaults branch October 8, 2025 22:23
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.

[name-defined] when PEP-696 type var uses another type var as default

3 participants