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
What about to replace the current way of reading machine-readable comments with a ready-made solution: metacode. This will not only simplify the internal implementation of mypy, but also eliminate some bugs of the current scheme.
Pitch
I have 2 linters that respond to the problem in the same line of code: ruff and mypy. Here is my code:
If I shut up ruff first and then mypy, I get an error from mypy:
some_file:227: error: Name "SignatureSeriesMatcher" is not defined [name-defined]
However, if I swap them like this:
# type: ignore[name-defined] # noqa: F821
... the mypy error disappears.
Obviously, mypy does not know how to correctly handle changing the order of machine-readable comments.
This problem can be solved quickly if you use a ready-made solution for reading such comments: metacode. This "out of the box" can read comments arranged in any order.
Activity
A5rocks commentedon Feb 12, 2026
For now, I think we're going to stick to what the Python AST module provides. However, feel free to drop a comment in #12358 about this!