You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will hopefully prepare at least one native parser fix (these are still not ready for PRs). These can be cherry-picked to the release branch, so they don't need to block release branch creation.
I tried out the release branch on my codebase at work and something about #21491 breaks the way defaults on type vars work and I start to get mypy doing defer assertion errors on my django querysets in a situation where they appear without a specified type var (as in MyQuerySet instead of MyQuerySet[MyModel]) (though tbf it's complicated) and if I change them to always have a value I start to get mypy failing to serialize placeholder types. I'm still investigating, but thought I'd mention that.
edit. ah, I found the problem, this seems to fix it but it breaks the unit tests, am still looking
From 84140edcb76aaf4b6bf3a2fd1f6a5ffc80277810 Mon Sep 17 00:00:00 2001
From: Stephen Moore <stephen.moore@kraken.tech>
Date: Wed, 24 Jun 2026 10:13:32 +1000
Subject: [PATCH] WIP: this makes a difference
---
mypy/semanal.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mypy/semanal.py b/mypy/semanal.py
index e010273b0..324910809 100644
--- a/mypy/semanal.py+++ b/mypy/semanal.py@@ -2009,7 +2009,7 @@ class SemanticAnalyzer(
# re-analyze this class. Note we force progress to handle cases like
# class C[T = C], this matches logic in process_typevar_parameters()
# for "old style" type variables.
- self.defer(force_progress=tvar_defs != defn.type_vars)+ self.mark_incomplete(defn.name, defn)
self.analyze_class_keywords(defn)
bases_result = self.analyze_base_classes(defn.name, bases)
--
2.50.1 (Apple Git-155)
edit2: it seems understanding this enough is a bit beyond me, I've created #21640
Section on closed TypedDicts is way too terse. It should have at least a basic example of usage.
Classes nested in functions is mostly an internal thing (although it does fix some user-facing issues as a side-effect). It should be either last in the sections, or maybe even not have a dedicated section at all.
We should probably have a (short) dedicated section announcing that type variable defaults support is now complete. IIUC we finally support all major features in the PEP/spec. That said, I think we are still missing the docs section for this (but I may be wrong). If this is the case, the docs should be added before the release is out.
IIUC TypeForm support is no longer experimental (this was merged in master before 2.1, but was reverted in 2.1 release branch because of a performance regression that is now partially mitigated). I think it is worth having a short section highlighting it is no longer experimental.
In the section about __new__() it is probably worth mentioning that mypy still gives an error at definition site if the explicit annotation is not a subtype of the current class (since this is technically not type-safe).
I think it is worth highlighting that we are now shipping experimental WASM wheel for Python 3.14.
There are a bunch of formatting problems: things that are conceptually "code", should be formatted as such, for example, write Union[TypedDict, dict[K, V]] , and not Union[TypedDict, dict[K, V]], num_workers and not num_workers, etc.
Added sections on type variable defaults, TypeForm support, and WASM wheels
Removed the nested classes section since we added a bunch more
Took an initial pass on code formatting
Would appreciate more eyes on the code samples to make sure those are good. I'll do another pass on formatting here in a bit but feel free to point any of those out as well.
Activity
JukkaL commentedon Jun 15, 2026
This is an important fix:
JukkaL commentedon Jun 15, 2026
I will hopefully prepare at least one native parser fix (these are still not ready for PRs). These can be cherry-picked to the release branch, so they don't need to block release branch creation.
esarp commentedon Jun 22, 2026
Release branch cut as
release-2.2from 5ef0902delfick commentedon Jun 23, 2026
I tried out the release branch on my codebase at work and something about #21491 breaks the way defaults on type vars work and I start to get mypy doing defer assertion errors on my django querysets in a situation where they appear without a specified type var (as in
MyQuerySetinstead ofMyQuerySet[MyModel]) (though tbf it's complicated) and if I change them to always have a value I start to get mypy failing to serialize placeholder types. I'm still investigating, but thought I'd mention that.edit. ah, I found the problem, this seems to fix it but it breaks the unit tests, am still looking
edit2: it seems understanding this enough is a bit beyond me, I've created #21640
ilevkivskyi commentedon Jul 1, 2026
I think dependency bumps #21663 and #21664 should be cherry-picked to release branch.
esarp commentedon Jul 1, 2026
We'll need to include bumps to librt (#21663) and ast (#21664) as wellComment above mentioned these alreadyilevkivskyi commentedon Jul 1, 2026
FYI mypyc/mypy_mypyc-wheels#116 adds Web Assembly wheels for mypy. Note however:
ilevkivskyi commentedon Jul 3, 2026
Note I just merged mypyc/mypy_mypyc-wheels#116, I am also updating the upload script to add the wasm wheels, see #21671
esarp commentedon Jul 6, 2026
Changelog is viewable here: https://github.com/esarp/mypy/blob/release-2.2/CHANGELOG.md
Release branch should include all the mentioned changes. If nothing else comes up, I'll plan on finishing up the release later today.
ilevkivskyi commentedon Jul 6, 2026
@esarp There are some issues with changelog:
TypeFormsupport is no longer experimental (this was merged in master before 2.1, but was reverted in 2.1 release branch because of a performance regression that is now partially mitigated). I think it is worth having a short section highlighting it is no longer experimental.__new__()it is probably worth mentioning that mypy still gives an error at definition site if the explicit annotation is not a subtype of the current class (since this is technically not type-safe).Union[TypedDict, dict[K, V]], and not Union[TypedDict, dict[K, V]],num_workersand not num_workers, etc.also cc @JukkaL
ilevkivskyi commentedon Jul 6, 2026
Btw @esarp all changelog updates should be merged in master as well.
esarp commentedon Jul 7, 2026
Put up a PR for the changelog: https://github.com/python/mypy/pull/21691/changes
TypedDictsectionTypeFormsupport, and WASM wheelsWould appreciate more eyes on the code samples to make sure those are good. I'll do another pass on formatting here in a bit but feel free to point any of those out as well.
esarp commentedon Jul 8, 2026
Version 2.2 is released: https://mypy-lang.blogspot.com/2026/07/mypy-22-released.html
hauntsaninja commentedon Jul 8, 2026
Regressions:
Patches for a bug release:
(feel free to edit)