python / python/mypy

Add support for 'post type-checking' hooks

Open
#6,537 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature priority-1-normal topic-plugins
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

I am opening this feature request as requested on gitter by @ilevkivskyi .
Currently mypy supports hooks for bases, decorators and metalcass, such as get_class_decorator_hook, etc. However those are called after semantic analysis and before type checking. It would be useful to support the same set of hooks to be called after type checking.

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 reading the existing get_class_decorator_hook and related base, decorator, and metaclass hook handling around semantic analysis and type checking. Determine where a post-type-checking phase could invoke the same hook set; the work is done when those hooks are supported after type checking with behavior consistent with the existing hooks.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.