Start propagating end columns/lines through for type-arg errors#18533
Start propagating end columns/lines through for type-arg errors#18533ilevkivskyi merged 2 commits intopython:masterfrom
type-arg errors#18533Conversation
Specifically, this addresses python#18531
|
@ilevkivskyi you said in #17535 (comment) that you would like to get rid of using types as error contexts. I assume this means this PR is a step in the wrong direction: what exactly should happen instead? (At the very least I don't think there's something else with the necessary information to improve (... reading through the issue, is there a reason why error context can't just include the file? it would be a bit more memory but otherwise seems like a fine solution) |
|
Diff from mypy_primer, showing the effect of this PR on open source code: sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/search/__init__.py:198: error: Name "nodes.meta" is not defined [name-defined]
+ sphinx/search/__init__.py:198:11: error: Name "nodes.meta" is not defined [name-defined]
pywin32 (https://github.com/mhammond/pywin32)
- win32/Lib/win32timezone.py:913: error: Name "winreg._KeyType" is not defined [name-defined]
+ win32/Lib/win32timezone.py:913:29: error: Name "winreg._KeyType" is not defined [name-defined]
- win32/Lib/win32timezone.py:920: error: Name "winreg._KeyType" is not defined [name-defined]
+ win32/Lib/win32timezone.py:920:19: error: Name "winreg._KeyType" is not defined [name-defined]
|
Not necessarily, I think this is a meaningful quick fix. Long term type annotations (essentially what |
Fixes #18531
It feels like this is a completely unsupported case given how major elements of mypy such as semanal don't pass through end columns/lines. Is this intentional? If so I'm fine closing this PR/the relevant issue as not planned.