Plugin: Use mypy to enrich AST with types
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
With the inspect/ast modules I can get an AST of e.g. a function and inspect variables - but in terms of types, I can only get the annotations from the signature (AFAIK).
Can mypy enrich the rest of the tree with types? And preferably expose this so that plugins can be written for it?
Does mypy already build a typed AST under the hood? Can you point me to where it happens?
Thank you
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 mentions Python's inspect and ast modules but names no mypy files, tests, or entry points. Start by locating where mypy builds its typed AST and determine whether a supported plugin-facing interface is feasible; done would require a defined way for plugins to access inferred types.
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