Skip to content

Straighten interface/implementation boundary#21270

Merged
ilevkivskyi merged 4 commits intopython:masterfrom
ilevkivskyi:interf-vs-impl-clean
Apr 20, 2026
Merged

Straighten interface/implementation boundary#21270
ilevkivskyi merged 4 commits intopython:masterfrom
ilevkivskyi:interf-vs-impl-clean

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

This is a follow-up to #21119

This avoids type-checking function signatures twice in two-phase checking. Luckily, things where already quite clean, only overloads needed some non-trivial logic (I guess this is why the daemon checks overloads as a whole). Some comments:

  • I didn't touch the daemon after all. When we will be more confident that this works well, we can simply set impl_only=True in the daemon (or actually just remove this flag altogether).
  • I found a bug while reading the code that we use bare (un-decorated) signatures for consistency checks for in-place/reverse special methods like __iadd__() and __radd__(), I just added TODOs for now, as these looks quite niche use cases.
  • Most of the PR is adding the missing docstring for checker.py.

cc @JukkaL

@github-actions

This comment has been minimized.

Comment thread mypy/checker.py Outdated
change this in future by adding a special kind of Any that signifies not ready type.

Second important aspect of architecture is two-phase checking. Currently, it is only
used in parallel type-checking mode, but at some point it will the default in sequential
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing word: will be the default

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi ilevkivskyi merged commit 9e76d34 into python:master Apr 20, 2026
24 checks passed
@ilevkivskyi ilevkivskyi deleted the interf-vs-impl-clean branch April 20, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants