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
* Fix a few inconsistencies in protocol/type object interactions (Ivan Levkivskyi, PR [19267](https://github.com/python/mypy/pull/19267))
48
+
* Refactor/unify access to static attributes (Ivan Levkivskyi, PR [19254](https://github.com/python/mypy/pull/19254))
49
+
* Remove inconsistencies in operator handling (Ivan Levkivskyi, PR [19250](https://github.com/python/mypy/pull/19250))
50
+
* Make protocol subtyping more consistent (Ivan Levkivskyi, PR [18943](https://github.com/python/mypy/pull/18943))
51
+
52
+
### Fixes to Nondeterministic Type Checking
53
+
54
+
Previous mypy versions could infer different types for certain expressions
55
+
across different runs (typically depending on which order certain types
56
+
were processed, and this order was nondeterministic). This release includes
57
+
fixes to several such issues.
58
+
59
+
* Fix nondeterministic type checking by making join with explicit Protocol and type promotion commute (Shantanu, PR [18402](https://github.com/python/mypy/pull/18402))
60
+
* Fix nondeterministic type checking caused by nonassociative of None joins (Shantanu, PR [19158](https://github.com/python/mypy/pull/19158))
61
+
* Fix nondeterministic type checking caused by nonassociativity of joins (Shantanu, PR [19147](https://github.com/python/mypy/pull/19147))
62
+
* Fix nondeterministic type checking by making join between `type` and TypeVar commute (Shantanu, PR [19149](https://github.com/python/mypy/pull/19149))
63
+
64
+
### Remove Support for Targeting Python 3.8
65
+
66
+
Mypy now requires `--python-version 3.9` or greater. Support for targeting Python 3.8 is
67
+
fully removed now. Since 3.8 is an unsupported version, mypy will default to the oldest
68
+
supported version (currently 3.9) if you still try to target 3.8.
10
69
11
70
This change is necessary because typeshed stopped supporting Python 3.8 after it
12
71
reached its End of Life in October 2024.
@@ -17,18 +76,133 @@ Contributed by Marc Mueller
17
76
### Initial Support for Python 3.14
18
77
19
78
Mypy is now tested on 3.14 and mypyc works with 3.14.0b3 and later.
20
-
Mypyc compiled wheels of mypy itself will be available for new versions after 3.14.0rc1 is released.
79
+
Binary wheels compiled with mypyc for mypy itself will be available for 3.14
80
+
some time after 3.14.0rc1 has been released.
21
81
22
-
Note that not all new features might be supported just yet.
82
+
Note that not all features are supported just yet.
23
83
24
84
Contributed by Marc Mueller (PR [19164](https://github.com/python/mypy/pull/19164))
25
85
26
-
### Deprecated Flag: \--force-uppercase-builtins
86
+
### Deprecated Flag: `--force-uppercase-builtins`
27
87
28
-
Mypy only supports Python 3.9+. The \--force-uppercase-builtins flag is now deprecated and a no-op. It will be removed in a future version.
88
+
Mypy only supports Python 3.9+. The `--force-uppercase-builtins` flag is now
89
+
deprecated as unnecessary, and a no-op. It will be removed in a future version.
29
90
30
91
Contributed by Marc Mueller (PR [19176](https://github.com/python/mypy/pull/19176))
31
92
93
+
### Mypyc: Improvements to Generators and Async Functions
94
+
95
+
This release includes both performance improvements and bug fixes related
96
+
to generators and async functions (these share many implementation details).
97
+
98
+
* Fix exception swallowing in async try/finally blocks with await (Chainfire, PR [19353](https://github.com/python/mypy/pull/19353))
99
+
* Fix AttributeError in async try/finally with mixed return paths (Chainfire, PR [19361](https://github.com/python/mypy/pull/19361))
* Use non-tagged integer for generator label (Jukka Lehtosalo, PR [19218](https://github.com/python/mypy/pull/19218))
103
+
* Merge generator and environment classes in simple cases (Jukka Lehtosalo, PR [19207](https://github.com/python/mypy/pull/19207))
104
+
105
+
### Mypyc: Partial, Unsafe Support for Free Threading
106
+
107
+
Mypyc has minimal, quite memory-unsafe support for the free threaded
108
+
builds of 3.14. It is also only lightly tested. Bug reports and experience
109
+
reports are welcome!
110
+
111
+
Here are some of the major limitations:
112
+
* Free threading only works when compiling a single module at a time.
113
+
* If there is concurrent access to an object while another thread is mutating the same
114
+
object, it's possible to encounter segfaults and memory corruption.
115
+
* There are no efficient native primitives for thread synthronization, though the
116
+
regular `threading` module can be used.
117
+
* Some workloads don't scale well to multiple threads for no clear reason.
118
+
119
+
Related PRs:
120
+
121
+
* Enable partial, unsafe support for free-threading (Jukka Lehtosalo, PR [19167](https://github.com/python/mypy/pull/19167))
122
+
* Fix incref/decref on free-threaded builds (Jukka Lehtosalo, PR [19127](https://github.com/python/mypy/pull/19127))
123
+
124
+
### Other Mypyc Fixes and Improvements
125
+
126
+
* Derive .c file name from full module name if using multi_file (Jukka Lehtosalo, PR [19278](https://github.com/python/mypy/pull/19278))
127
+
* Support overriding the group name used in output files (Jukka Lehtosalo, PR [19272](https://github.com/python/mypy/pull/19272))
128
+
* Add note about using non-native class to subclass built-in types (Jukka Lehtosalo, PR [19236](https://github.com/python/mypy/pull/19236))
129
+
* Make some generated classes implicitly final (Jukka Lehtosalo, PR [19235](https://github.com/python/mypy/pull/19235))
130
+
* Don't simplify module prefixes if using separate compilation (Jukka Lehtosalo, PR [19206](https://github.com/python/mypy/pull/19206))
131
+
132
+
### Stubgen Improvements
133
+
134
+
* Add import for `types` in `__exit__` method signature (Alexey Makridenko, PR [19120](https://github.com/python/mypy/pull/19120))
135
+
* Add support for including class and property docstrings (Chad Dombrova, PR [17964](https://github.com/python/mypy/pull/17964))
* Support several more constructs in stubgen's alias printer (Stanislav Terliakov, PR [18888](https://github.com/python/mypy/pull/18888))
138
+
139
+
### Miscellaneous Fixes and Improvements
140
+
141
+
* Combine the revealed types of multiple iteration steps in a more robust manner (Christoph Tyralla, PR [19324](https://github.com/python/mypy/pull/19324))
142
+
* Improve the handling of "iteration dependent" errors and notes in finally clauses (Christoph Tyralla, PR [19270](https://github.com/python/mypy/pull/19270))
143
+
* Lessen dmypy suggest path limitations for Windows machines (CoolCat467, PR [19337](https://github.com/python/mypy/pull/19337))
144
+
* Fix type ignore comments erroneously marked as unused by dmypy (Charlie Denton, PR [15043](https://github.com/python/mypy/pull/15043))
* Fix missing error context for unpacking assignment involving star expression (Brian Schubert, PR [19258](https://github.com/python/mypy/pull/19258))
147
+
* Fix and simplify error de-duplication (Ivan Levkivskyi, PR [19247](https://github.com/python/mypy/pull/19247))
148
+
* Disallow `ClassVar` in type aliases (Brian Schubert, PR [19263](https://github.com/python/mypy/pull/19263))
149
+
* Add script that prints list of compiled files when compiling mypy (Jukka Lehtosalo, PR [19260](https://github.com/python/mypy/pull/19260))
150
+
* Fix help message url for "None and Optional handling" section (Guy Wilson, PR [19252](https://github.com/python/mypy/pull/19252))
151
+
* Display fully qualified name of imported base classes in errors about incompatible overrides (Mikhail Golubev, PR [19115](https://github.com/python/mypy/pull/19115))
152
+
* Avoid false `unreachable`, `redundant-expr`, and `redundant-casts` warnings in loops more robustly and efficiently, and avoid multiple `revealed type` notes for the same line (Christoph Tyralla, PR [19118](https://github.com/python/mypy/pull/19118))
153
+
* Fix type extraction from `isinstance` checks (Stanislav Terliakov, PR [19223](https://github.com/python/mypy/pull/19223))
154
+
* Erase stray type variables in `functools.partial` (Stanislav Terliakov, PR [18954](https://github.com/python/mypy/pull/18954))
155
+
* Make inferring condition value recognize the whole truth table (Stanislav Terliakov, PR [18944](https://github.com/python/mypy/pull/18944))
156
+
* Support type aliases, `NamedTuple` and `TypedDict` in constrained TypeVar defaults (Stanislav Terliakov, PR [18884](https://github.com/python/mypy/pull/18884))
157
+
* Move dataclass `kw_only` fields to the end of the signature (Stanislav Terliakov, PR [19018](https://github.com/python/mypy/pull/19018))
158
+
* Provide a better fallback value for the `python_version` option (Marc Mueller, PR [19162](https://github.com/python/mypy/pull/19162))
159
+
* Avoid spurious non-overlapping equality error with metaclass with `__eq__` (Michael J. Sullivan, PR [19220](https://github.com/python/mypy/pull/19220))
160
+
* Narrow type variable bounds (Ivan Levkivskyi, PR [19183](https://github.com/python/mypy/pull/19183))
161
+
* Add classifier for Python 3.14 (Marc Mueller, PR [19199](https://github.com/python/mypy/pull/19199))
* Emit a friendlier warning on invalid exclude regex, instead of a stacktrace (wyattscarpenter, PR [19102](https://github.com/python/mypy/pull/19102))
170
+
* Enable ANSI color codes for dmypy client in Windows (wyattscarpenter, PR [19088](https://github.com/python/mypy/pull/19088))
171
+
* Extend special case for context-based type variable inference to unions in return position (Stanislav Terliakov, PR [18976](https://github.com/python/mypy/pull/18976))
172
+
173
+
### Mypy 1.17.1
174
+
* Retain `None` as constraints bottom if no bottoms were provided (Stanislav Terliakov, PR [19485](https://github.com/python/mypy/pull/19485))
175
+
* Fix "ignored exception in `hasattr`" in dmypy (Stanislav Terliakov, PR [19428](https://github.com/python/mypy/pull/19428))
176
+
* Prevent a crash when InitVar is redefined with a method in a subclass (Stanislav Terliakov, PR [19453](https://github.com/python/mypy/pull/19453))
177
+
178
+
### Acknowledgements
179
+
180
+
Thanks to all mypy contributors who contributed to this release:
181
+
182
+
* Alexey Makridenko
183
+
* Brian Schubert
184
+
* Chad Dombrova
185
+
* Chainfire
186
+
* Charlie Denton
187
+
* Charulata
188
+
* Christoph Tyralla
189
+
* CoolCat467
190
+
* Donal Burns
191
+
* Guy Wilson
192
+
* Ivan Levkivskyi
193
+
* johnthagen
194
+
* Jukka Lehtosalo
195
+
* Łukasz Kwieciński
196
+
* Marc Mueller
197
+
* Michael J. Sullivan
198
+
* Mikhail Golubev
199
+
* Sebastian Rittau
200
+
* Shantanu
201
+
* Stanislav Terliakov
202
+
* wyattscarpenter
203
+
204
+
I’d also like to thank my employer, Dropbox, for supporting mypy development.
205
+
32
206
## Mypy 1.16
33
207
34
208
We’ve just uploaded mypy 1.16 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)).
0 commit comments