Skip to content

Fix type checking of dict type aliases#20170

Merged
ilevkivskyi merged 1 commit into
python:masterfrom
hauntsaninja:dict-alias
Nov 3, 2025
Merged

Fix type checking of dict type aliases#20170
ilevkivskyi merged 1 commit into
python:masterfrom
hauntsaninja:dict-alias

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Nov 3, 2025

Copy link
Copy Markdown
Collaborator

Resolves a bad false negative and a false positive

Previously, for D = dict[str, str] we would require a type annotation for d = D() and we would fail to error on D(x=1)

Fixes #11093, fixes #11246, fixes #13320, fixes #16047

Resolves a bad false negative and a false positive

Previously, for `D = dict[str, str]` we would require a type annotation
for `d = D()` and we would fail to error on `D(x=1)`

Fixes python#11093, fixes python#11246
@github-actions

github-actions Bot commented Nov 3, 2025

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 62770f4 into python:master Nov 3, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants