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] Minor: fix Literal[True] <: int #14177

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Nov 7, 2024

Summary

Minor fix to Type::is_subtype_of to make sure that Boolean literals are subtypes of int, to match runtime semantics.

Found this while doing some property-testing experiments.

Test Plan

New unit test.

@sharkdp sharkdp added the red-knot Multi-file analysis & type inference label Nov 7, 2024
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!

@sharkdp sharkdp force-pushed the david/fix-bool-literal-subtype-int branch from 74ba518 to 38d93ea Compare November 7, 2024 22:15
@sharkdp sharkdp mentioned this pull request Nov 7, 2024
5 tasks
@sharkdp sharkdp merged commit 2624249 into main Nov 7, 2024
20 checks passed
@sharkdp sharkdp deleted the david/fix-bool-literal-subtype-int branch November 7, 2024 22:23
Copy link
Contributor

github-actions bot commented Nov 7, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

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.

2 participants