pypi / mypy
mypy
What changed in mypy 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
1 breaking3 behavior and defaults1 tooling24 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmypy 24 changes
Fixes and other changes 4
Clears the mypyc coroutine environment when a coroutine completes.
Fixes mypyc handling of default_factory for inherited dataclasses.
Fixes a mypyc crash when an Iterator yields twice.
Fixes a crash when unpacking a return value from an overload.
mypy 125 changes
Breaking changes 1
Mypy now fails with an explicit error on PyPy.
Behavior and default changes 3
Allows dangerous identity comparisons involving variables typed as Any.
Sync is always disabled in the SQLite cache.
This flag is no longer treated as a strict flag.
Tooling 1
Adds initial support for Python 3.15.0a8.
Fixes and other changes 20
Fixes a regression related to generic callables.
Fixes an issue with module dunder attributes in mypyc.
Mypy now correctly aggregates narrowing information on parent expressions.
Fixes mypyc match statement semantics for or patterns.
Fixes slicing behavior in non-strict optional mode.
Avoids widening types in some contexts to fix a regression.
Fixes narrowing with chained comparisons.
The typeshed change to dict.__or__ types is reverted, changing how mypy checks those operations.
Fixes a regression involving catching an empty tuple in an except clause.
Fixes reachability analysis for narrowing frozenset and dict views.
Avoids narrowing to an unreachable type at module level.
Avoids narrowing type[T] in type calls.
Fixes narrowing for match cases involving variadic tuples.
Fixes noncommutative joins involving bounded TypeVars, improving type-checking results.
Fixes a mypyc generator regression involving an empty tuple.
Fixes a crash when a type variable with a forward reference is used in another module.
Cached runs now respect the selected output format by serializing raw errors in cache metadata.
Fixes a crash when a star import encounters a redefinition.
Allows types.NoneType in match cases.
Fixes a crash involving an Unpack-ed TypeVarTuple.