Open
Description
Feature or enhancement
Add a flag to ast.parse
that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc.
Pitch
Currently, ast.parse
produces directives for type: ignore
only, which all type checkers respond to. PyRight reacts to its own special pyright: ignore
flag to disambiguate type errors that are specific to it. MyPy cannot easily implement a similar flag since it depends on ast.parse
. Yet a mypy: ignore
directive is needed.
A concrete interface is proposed here by @jab.
Previous discussion
Discussion here. Guido suggests a passing a list of namespaces the caller is interested in. This would make the function output easier to parse, and possibly more efficient.