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

[red-knot] Decompose bool to Literal[True, False] in unions and intersections (v2) #15773

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AlexWaygood
Copy link
Member

Summary

An alternative to #15738, which might be slightly more readable and easier to reason about. I'm also curious to see how this compares with the Codspeed benchmarks.

Test Plan

Same tests as #15738

@AlexWaygood AlexWaygood added the red-knot Multi-file analysis & type inference label Jan 27, 2025
@AlexWaygood
Copy link
Member Author

@sharkdp -- curious if you find this more or less easy to understand than #15738? The final commit here is the only difference between the two. (I'll add a comment to the branch about boolean literals delegating to KnownClass::Int whichever of the two we decide we prefer for readability.)

Performance seems to be basically the same between the two. Maybe this one is a tiny bit slower? But it could just be noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant