Skip to content

Add context information for infer_literal_expr_type#21554

Open
97littleleaf11 wants to merge 2 commits into
python:masterfrom
97littleleaf11:add-ctx-for-infer-literal-2
Open

Add context information for infer_literal_expr_type#21554
97littleleaf11 wants to merge 2 commits into
python:masterfrom
97littleleaf11:add-ctx-for-infer-literal-2

Conversation

@97littleleaf11
Copy link
Copy Markdown
Collaborator

Add missing context information for literal type. Previous #11754

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@97littleleaf11 97littleleaf11 requested a review from sobolevn May 29, 2026 04:56
Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

The change looks good to me, but I am not sure about the test though :)

It seems overly complex. Is there any other way to test this? Maybe reuse some existing error that shows the line info on the literal type?

@97littleleaf11
Copy link
Copy Markdown
Collaborator Author

97littleleaf11 commented May 29, 2026

I don't find any existing test case for this. or I can remove the test case > <

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants