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] support narrowing on constants in matches #16974

Merged
merged 4 commits into from
Mar 28, 2025

Conversation

ericmarkmartin
Copy link
Contributor

@ericmarkmartin ericmarkmartin commented Mar 26, 2025

Summary

Part of #13694

The implementation here was suspiciously straightforward so please lmk if I missed something

Also some drive-by changes to DRY things up a bit

Test Plan

Add new tests to narrow/match.md

Copy link
Contributor

github-actions bot commented Mar 26, 2025

mypy_primer results

No ecosystem changes detected ✅

@AlexWaygood AlexWaygood added the red-knot Multi-file analysis & type inference label Mar 26, 2025
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Nice, this looks great. A couple of minor comments:

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.

Very nice, thank you!

@carljm carljm enabled auto-merge (squash) March 28, 2025 02:33
@carljm carljm merged commit 3acf4e7 into astral-sh:main Mar 28, 2025
22 checks passed
@ericmarkmartin ericmarkmartin deleted the match-value-narrowing branch March 28, 2025 04:53
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.

None yet

3 participants