Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line number for decorator issues #18392

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #18391

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

antidote (https://github.com/Finistere/antidote)
+ tests/core/test_inject.py:548: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/core/test_inject.py:549: error: Argument 1 to "method" of "Inject" has incompatible type "Callable[[], object]"; expected "Callable[[Any], object]"  [arg-type]

Copy link
Contributor

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

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

This makes sense. I assume the end line is at the actual def ... line?

@hauntsaninja
Copy link
Collaborator Author

end line is the same, just matches end_lineno provided by the python ast

@hauntsaninja hauntsaninja merged commit 9bf5169 into python:master Dec 31, 2024
18 checks passed
@hauntsaninja hauntsaninja deleted the fix-deco-line branch December 31, 2024 23:09
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Dec 31, 2024
Fixes python#17655

The decorator cleanup moves a type ignore, but so does the bug fix
in python#18392 , so might as well batch into a single release
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.

mypy reports the wrong line number for decorator issues
2 participants