Add comments parsing flag to ast.parse
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the ast.parse entry point and read the linked mypy issue and discuss.python.org discussion. The proposed interface is not settled: compare the namespace-list approach with the concrete proposal, then define the API and parsing behavior needed for directives such as type: ignore, pyright: ignore, and mypy: ignore.
Written by the indexing model from the issue text.
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.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 558
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/cpython
-
docs pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
build type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
stdlib topic-email type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
🐛 Bug 🔔 Pending processing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
jumpserver/jumpserver#17584 ·