Plugin hook for preprocessing annotations
Open
Nobody has claimed this yet.
feature
priority-2-low
topic-plugins
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
I want to add some custom annotations on my variables. For example,
def idiv(left: int, right: int | right != 0) -> int:
return left // right
Mypy accepts only PEP 484 type hints, so I'd like to provide a plugin to pre-process this annotation and return a PEP 484-compatible hint before Mypy checks it. Could Mypy provide a preprocessing hook for such transformations?
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.
Research direction
The issue names no files, tests, or entry points; start by locating mypy's plugin and annotation-processing interfaces. Clarify the supported transformation model and define completion with a documented hook that produces a PEP 484-compatible annotation before type checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100