python / python/mypy

Refactor and document conditional type binder

Open
#7,324 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority-0-high refactoring topic-type-narrowing
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Conditional type binder (mypy's version of abstract interpreter) is one of the trickiest part of mypy. It would be great to clean-up its implementation and document the current behaviour. As and optional additional related thing (or a follow-up step), I would propose to refactor/rethink partial types (that IMO should be handled by the binder).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating mypy's conditional type binder and reading its current implementation and tests. Document the existing behavior and define the cleanup scope before considering whether partial types should be handled by the binder. Done means the binder's behavior is documented and its implementation is clearer, with any partial-type redesign treated as a separate follow-up if needed.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.