Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented May 20, 2025

Summary

This PR applies deep normalization to many type variants that wrap other types. This should mean that we have more robust handling for equivalence and gradual equivalence even when encountering differently ordered unions.

I went down this road because I was hoping it would solve astral-sh/ty#459. It doesn't look like it does (at least not on its own), but it seems like something that should make us more robust in the long term anyway.

Test Plan

cargo test -p ty_python_semantic

@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label May 20, 2025
@github-actions
Copy link
Contributor

mypy_primer results

No ecosystem changes detected ✅

@AlexWaygood
Copy link
Member Author

1% speedup on the many_string_assignments benchmark! No idea why, but I'll take it 😄 https://codspeed.io/astral-sh/ruff/branches/alex%2Fdeeply-normalize

@AlexWaygood AlexWaygood marked this pull request as ready for review May 20, 2025 15:32
@AlexWaygood AlexWaygood added the internal An internal refactor or improvement label May 20, 2025
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Thank you!

@AlexWaygood AlexWaygood merged commit 60b486a into main May 20, 2025
35 checks passed
@AlexWaygood AlexWaygood deleted the alex/deeply-normalize branch May 20, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants