Use new type inference as a primary mechanism
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Depends on https://github.com/python/mypy/issues/15906. This is a follow-up for series started by https://github.com/python/mypy/pull/15287
Currently new (polymorphic) inference is used as a fallback if the traditional algorithm fails (one way or another). At some point we should switch to the new inference scheme entirely. This would include:
- Use polymorphic inference during unification in subtyping.
- Use polymorphic inference as primary mechanism for all inference passes (return type, arguments first pass, arguments second pass).
- Move
apply_poly()logic fromcheckexpr.pytoapplytype.py.
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
Start with dependency issue #15906 and the follow-up series from pull request #15287. Read the current inference paths and the apply_poly() logic in checkexpr.py, then review applytype.py. Done means polymorphic inference is used during subtyping unification and as the primary mechanism for return-type and both argument inference passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100