@@ -16,7 +16,7 @@ You can read the full documentation for this release on [Read the Docs](http://m
1616
1717Mypy now supports a new cache format used for faster incremental builds. It makes
1818incremental builds up to twice as fast. The feature is experimental and
19- currently only supported when using a compiled mypy. Use ` --fixed-format-cache `
19+ currently only supported when using a compiled version of mypy. Use ` --fixed-format-cache `
2020to enable the new format, or ` fixed_format_cache = True ` in a configuration file.
2121
2222We plan to enable this by default in a future mypy release, and we'll eventually
@@ -36,17 +36,17 @@ This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/p
3636Mypy 1.18 includes numerous performance improvements, resulting in about 38% speedup
3737compared to 1.17 when type checking mypy itself. In extreme cases, the improvement
3838can be 10x or higher. The list below is an overview of the various mypy optimizations.
39- Many mypyc improvements (discussed in a separate secion below) also improve performance.
39+ Many mypyc improvements (discussed in a separate section below) also improve performance.
4040
4141- Improve self check performance by 1.8% (Jukka Lehtosalo, PR [ 19768] ( https://github.com/python/mypy/pull/19768 ) , [ 19769] ( https://github.com/python/mypy/pull/19769 ) , [ 19770] ( https://github.com/python/mypy/pull/19770 ) )
42- - Optimize fixed format deserialization (Ivan Levkivskyi, PR [ 19765] ( https://github.com/python/mypy/pull/19765 ) )
43- - Use macros to optimize fixed format deserialization (Ivan Levkivskyi, PR [ 19757] ( https://github.com/python/mypy/pull/19757 ) )
42+ - Optimize fixed- format deserialization (Ivan Levkivskyi, PR [ 19765] ( https://github.com/python/mypy/pull/19765 ) )
43+ - Use macros to optimize fixed- format deserialization (Ivan Levkivskyi, PR [ 19757] ( https://github.com/python/mypy/pull/19757 ) )
4444- Two additional micro‑optimizations (Ivan Levkivskyi, PR [ 19627] ( https://github.com/python/mypy/pull/19627 ) )
4545- Another set of micro‑optimizations (Ivan Levkivskyi, PR [ 19633] ( https://github.com/python/mypy/pull/19633 ) )
4646- Cache common types (Ivan Levkivskyi, PR [ 19621] ( https://github.com/python/mypy/pull/19621 ) )
4747- Skip more method bodies in third‑party libraries for speed (Ivan Levkivskyi, PR [ 19586] ( https://github.com/python/mypy/pull/19586 ) )
4848- Simplify the representation of callable types (Ivan Levkivskyi, PR [ 19580] ( https://github.com/python/mypy/pull/19580 ) )
49- - Add cache for types of call expressions cache (Ivan Levkivskyi, PR [ 19505] ( https://github.com/python/mypy/pull/19505 ) )
49+ - Add cache for types of some expressions (Ivan Levkivskyi, PR [ 19505] ( https://github.com/python/mypy/pull/19505 ) )
5050- Use cache for dictionary expressions (Ivan Levkivskyi, PR [ 19536] ( https://github.com/python/mypy/pull/19536 ) )
5151- Use cache for binary operations (Ivan Levkivskyi, PR [ 19523] ( https://github.com/python/mypy/pull/19523 ) )
5252- Cache types of type objects (Ivan Levkivskyi, PR [ 19514] ( https://github.com/python/mypy/pull/19514 ) )
@@ -70,7 +70,7 @@ Many mypyc improvements (discussed in a separate secion below) also improve perf
7070
7171Mypy 1.16.0 introduced ` --allow-redefinition-new ` , which allows redefining variables
7272with different types, and inferring union types for variables from multiple assignments.
73- The feature is now documented in ` --help ` output, but the feature is still experimental.
73+ The feature is now documented in the ` --help ` output, but the feature is still experimental.
7474
7575We are planning to enable this by default in mypy 2.0, and we will also deprecate the
7676older ` --allow-redefinition ` flag. Since the new behavior differs significantly from
@@ -100,9 +100,10 @@ This feature was contributed by Ivan Levkivskyi (PR [19573](https://github.com/p
100100
101101### Disjoint Base Classes (@disjoint_base, PEP 800)
102102
103- Mypy now implements PEP 800 Disjoint bases: it understands the ` @disjoint_base `
104- decorator, and rejects class definitions that combine mutually incompatible base classess,
105- and exploits the fact that such classes cannot exist in reachability and narrowing logic.
103+ Mypy now understands disjoint bases (PEP 800): it recognizes the ` @disjoint_base `
104+ decorator, and rejects class definitions that combine mutually incompatible base classes,
105+ and takes advantage of the fact that such classes cannot exist in reachability and
106+ narrowing logic.
106107
107108This class definition will now generate an error:
108109
@@ -138,11 +139,12 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py
138139### Experimental Free-threading Support for Mypyc
139140
140141All mypyc tests now pass on free-threading 3.14 release candidate builds. The performance
141- of various micro-benchmarks scale well when using multiple threads.
142+ of various micro-benchmarks scale well across multiple threads.
142143
143- Free-threading support is still experimental. Note that native attribute get and set
144- operations, list item access and certain other operations are still unsafe when there are
145- race conditions. This will likely change in the future. You can follow the
144+ Free-threading support is still experimental. Note that native attribute access
145+ (get and set), list item access and certain other operations are still
146+ unsafe when there are race conditions. This will likely change in the future.
147+ You can follow the
146148[ area-free-threading label] ( https://github.com/mypyc/mypyc/issues?q=is%3Aissue%20state%3Aopen%20label%3Aarea-free-threading )
147149in the mypyc issues tracker to follow progress.
148150
@@ -175,8 +177,8 @@ Related PRs:
175177- Speed up implicit ` __ne__ ` (Jukka Lehtosalo, PR [ 19759] ( https://github.com/python/mypy/pull/19759 ) )
176178- Speed up equality with optional str/bytes types (Jukka Lehtosalo, PR [ 19758] ( https://github.com/python/mypy/pull/19758 ) )
177179- Speed up access to empty tuples (BobTheBuidler, PR [ 19654] ( https://github.com/python/mypy/pull/19654 ) )
178- - Speed up calls with ` *args ` (BobTheBuidler, PR [ 19631] ( https://github.com/python/mypy/pull/19631 ) )
179180- Speed up calls with ` *args ` (BobTheBuidler, PR [ 19623] ( https://github.com/python/mypy/pull/19623 ) )
181+ - Further speed up calls with ` *args ` (BobTheBuidler, PR [ 19631] ( https://github.com/python/mypy/pull/19631 ) )
180182- Speed up calls with ` **kwargs ` (BobTheBuidler, PR [ 19630] ( https://github.com/python/mypy/pull/19630 ) )
181183- Optimize ` type(x) ` , ` x.__class__ ` , and ` <type>.__name__ ` (Jukka Lehtosalo, PR [ 19691] ( https://github.com/python/mypy/pull/19691 ) , [ 19683] ( https://github.com/python/mypy/pull/19683 ) )
182184- Specialize ` bytes.decode ` for common encodings (Jukka Lehtosalo, PR [ 19688] ( https://github.com/python/mypy/pull/19688 ) )
@@ -185,7 +187,7 @@ Related PRs:
185187- Add dictionary set item for exact dict instances (BobTheBuidler, PR [ 19657] ( https://github.com/python/mypy/pull/19657 ) )
186188- Cache length when iterating over immutable types (BobTheBuidler, PR [ 19656] ( https://github.com/python/mypy/pull/19656 ) )
187189- Fix name conflict related to attributes of generator classes (Piotr Sawicki, PR [ 19535] ( https://github.com/python/mypy/pull/19535 ) )
188- - Fix segfault from heap type objects with static doc string (Brian Schubert, PR [ 19636] ( https://github.com/python/mypy/pull/19636 ) )
190+ - Fix segfault from heap type objects with a static docstring (Brian Schubert, PR [ 19636] ( https://github.com/python/mypy/pull/19636 ) )
189191- Unwrap NewType to its base type for additional optimizations (BobTheBuidler, PR [ 19497] ( https://github.com/python/mypy/pull/19497 ) )
190192- Generate an export table only for separate compilation (Jukka Lehtosalo, PR [ 19521] ( https://github.com/python/mypy/pull/19521 ) )
191193- Speed up ` isinstance ` with built‑in types (Piotr Sawicki, PR [ 19435] ( https://github.com/python/mypy/pull/19435 ) )
@@ -197,7 +199,7 @@ Related PRs:
197199- Use per‑type freelists for nested functions (Jukka Lehtosalo, PR [ 19390] ( https://github.com/python/mypy/pull/19390 ) )
198200- Simplify comparison of tuple elements (Piotr Sawicki, PR [ 19396] ( https://github.com/python/mypy/pull/19396 ) )
199201- Generate introspection signatures for compiled functions (Brian Schubert, PR [ 19307] ( https://github.com/python/mypy/pull/19307 ) )
200- - Fix to undefined attribute checking (Jukka Lehtosalo, PR [ 19378] ( https://github.com/python/mypy/pull/19378 ) )
202+ - Fix undefined attribute checking special case (Jukka Lehtosalo, PR [ 19378] ( https://github.com/python/mypy/pull/19378 ) )
201203- Fix comparison of tuples with different lengths (Piotr Sawicki, PR [ 19372] ( https://github.com/python/mypy/pull/19372 ) )
202204- Speed up ` list.clear ` (Jahongir Qurbonov, PR [ 19344] ( https://github.com/python/mypy/pull/19344 ) )
203205- Speed up ` weakref.proxy ` (BobTheBuidler, PR [ 19217] ( https://github.com/python/mypy/pull/19217 ) )
@@ -254,7 +256,7 @@ Related PRs:
254256- Support ` _value_ ` as a fallback for ellipsis Enum members (Stanislav Terliakov, PR [ 19352] ( https://github.com/python/mypy/pull/19352 ) )
255257- Sort arguments in TypedDict overlap messages (Marc Mueller, PR [ 19666] ( https://github.com/python/mypy/pull/19666 ) )
256258- Fix handling of implicit return in lambda (Stanislav Terliakov, PR [ 19642] ( https://github.com/python/mypy/pull/19642 ) )
257- - Add ambiguous to uninhabited type identity for better messaging (Stanislav Terliakov, PR [ 19648] ( https://github.com/python/mypy/pull/19648 ) )
259+ - Improve behavior of uninhabited types (Stanislav Terliakov, PR [ 19648] ( https://github.com/python/mypy/pull/19648 ) )
258260- Fix overload diagnostics when ` *args ` and ` **kwargs ` both match (Shantanu, PR [ 19614] ( https://github.com/python/mypy/pull/19614 ) )
259261- Further fix overload diagnostics for ` *args ` /` **kwargs ` (Shantanu, PR [ 19619] ( https://github.com/python/mypy/pull/19619 ) )
260262- Show type variable name in "Cannot infer type argument" (Brian Schubert, PR [ 19290] ( https://github.com/python/mypy/pull/19290 ) )
0 commit comments