Add `new_typeinfo` to public plugin API for both SemanticAnalyzer and TypeChecker
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
In django-stubs, it's used in a lot of places to generate one-off classes.
For semanal, there's https://github.com/python/mypy/blob/master/mypy/semanal.py#L3029, which used for the special casing of NamedTuple/TypedDict/others, which basically plugins in the core.
For type checking, there's no equivalent, but similar code is used here https://github.com/python/mypy/blob/master/mypy/checker.py#L3659
It would be also nice to be able to specify more than one base class.
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
Read mypy/semanal.py#L3029 and mypy/checker.py#L3659 first, comparing the existing one-off class creation paths used by plugins and type checking. Define the public plugin API for both SemanticAnalyzer and TypeChecker, including support for multiple base classes; done when both entry points expose it for django-stubs-style use.
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
- Mostly clear
- Newbie friendliness
- 35/100