You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases mypy error messages don't point to the expected location, especially when using --show-column-numbers. Example:
deff(x: int) ->None: pass# Mypy message points to 'f' at the beginning of the linef(
'foo')
# ^ I'd expect the error point to 'foo' here
This is a significant usability issue when running mypy from an editor, especially if error locations are highlighted in the code. Having the correct line number would help usability in general, however.
It would be good to go through selected common error messages, such as invalid argument, undefined name, missing attribute, and incompatible assignment, and make sure that the line/column numbers point to the correct part of the expression/statement.
Note that this may break existing # type: ignore comments. I don't think that there's a way around this, other than perhaps providing a tool that can automatically move # type: ignore comments to the new locations.
This is basically a subset of existing issues #4276 and #4829. The original issues are too wide-ranging to be actionable in the short term, but fixing a few common messages would solve perhaps 80% of the problem without much effort.
The text was updated successfully, but these errors were encountered:
Most notably, report more precise error locations for incompatible
return value types and incompatible default argument values.
Also add some tests.
Work towards #7053.
In some cases mypy error messages don't point to the expected location, especially when using
--show-column-numbers
. Example:This is a significant usability issue when running mypy from an editor, especially if error locations are highlighted in the code. Having the correct line number would help usability in general, however.
It would be good to go through selected common error messages, such as invalid argument, undefined name, missing attribute, and incompatible assignment, and make sure that the line/column numbers point to the correct part of the expression/statement.
Note that this may break existing
# type: ignore
comments. I don't think that there's a way around this, other than perhaps providing a tool that can automatically move# type: ignore
comments to the new locations.This is basically a subset of existing issues #4276 and #4829. The original issues are too wide-ranging to be actionable in the short term, but fixing a few common messages would solve perhaps 80% of the problem without much effort.
The text was updated successfully, but these errors were encountered: