Skip to content

Conversation

@asukaminato0721
Copy link
Contributor

fix #252

Scrut is not installed, skipping scrut tests.
Finished in 491.39 seconds.
Running conformance tests...
Finished in 4.71 seconds.
@meta-cla meta-cla bot added the cla signed label Oct 21, 2025
@asukaminato0721 asukaminato0721 marked this pull request as ready for review October 21, 2025 03:43
Copy link
Contributor

@rchen152 rchen152 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I'd like to discuss this a bit further before moving forward - Danny's comment on the issue raises some good questions.

  • What operations do we want to support? + is a good start, but what about -, *, **, etc.? I'd be okay with doing only + in this PR and building on it in later PRs, but I just wanted to flag that as-is this isn't a complete fix.
  • How should unions of literals be handled? I believe the current behavior of this PR is to distribute over unions (e.g., adding Literal[1, 2] and Literal[3, 5] will produce Literal[4, 5, 6, 7]), which could be problematic for large unions.
  • Should we do anything special for loops and lambdas? Pyright disables literal math in those cases.

cc @yangdanny97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More precise inferred type for literal ints

2 participants