Skip to content

Conversation

@AA-Turner
Copy link
Member

Recently, mypy gained the ability to output errors/notes as structured data in JSON format. This data, though, lacks the end_line and end_column information from mypy's ErrorTuple, which makes it harder to use for e.g. IDE integrations.

This is a fairly simple PR to just expose those fields in the JSON. I updated the constructor of MypyError to put the new arguments in the middle rather than at the end because I understand that this is an internal type, so we're free to make changes like this -- please correct me if I'm wrong here.

I just updated the existing tests rather than adding new ones, hopefully this is fine!

A

cc @JelleZijlstra as reviewer of #11396

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

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

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

LG, thanks!

@ilevkivskyi ilevkivskyi merged commit 47cae93 into python:master Feb 4, 2026
23 checks passed
@AA-Turner AA-Turner deleted the json-span-info branch February 4, 2026 14:31
@AA-Turner
Copy link
Member Author

Thanks @ilevkivskyi!

A

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