Conversation
p-sawicki
approved these changes
Sep 11, 2025
ilevkivskyi
approved these changes
Sep 11, 2025
| ### `--allow-redefinition-new` | ||
| ### Mypy Performance Improvements | ||
|
|
||
| Mypy 1.18 includes numerous performance improvements, resulting in about 38% speedup |
Member
There was a problem hiding this comment.
IMO this is unnecessarily precise, saying ~40% may be better.
| Mypy 1.18 includes numerous performance improvements, resulting in about 38% speedup | ||
| compared to 1.17 when type checking mypy itself. In extreme cases, the improvement | ||
| can be 10x or higher. The list below is an overview of the various mypy optimizations. | ||
| Many mypyc improvements (discussed in a separate section below) also improve performance. |
Member
There was a problem hiding this comment.
Should we mention --disable-expression-cache just in case, or only advise it when people report bugs?
| convert fixed-format cache files to JSON, but details of the output JSON may be | ||
| different from the current JSON format. If you rely on being able to inspect | ||
| mypy cache files, we recommend creating a GitHub issue and explaining your use | ||
| case, so that we can more likely provide support for it. |
Member
There was a problem hiding this comment.
Maybe also mention using MypyFile.read(data) to inspect cache, which may be sufficient for some users?
|
|
||
| Mypy 1.18 includes numerous performance improvements, resulting in a 38% overall speedup compared to 1.17 | ||
| - Add `--strict-equality-for-none` to flag non-overlapping comparisons involving None (Christoph Tyralla, PR [19718](https://github.com/python/mypy/pull/19718)) | ||
| - Don’t show import‑related errors after a module‑level `assert False` (Stanislav Terliakov, PR [19347](https://github.com/python/mypy/pull/19347)) |
Member
There was a problem hiding this comment.
Not sure if it makes sense to clarify that this is for cases like assert sys.platform == "linux" at top of file.
|
|
||
| ### Experimental Free-threading Support for Mypyc | ||
|
|
||
| All mypyc tests now pass on free-threading 3.14 release candidate builds. The performance |
Member
There was a problem hiding this comment.
Suggested change
| All mypyc tests now pass on free-threading 3.14 release candidate builds. The performance | |
| All mypyc tests now pass on free-threading Python 3.14 release candidate builds. The performance |
|
|
||
| ### Mypyc: Support `__new__` | ||
|
|
||
| Mypyc now has rudimentary support for `__new__` methods. |
Member
There was a problem hiding this comment.
Suggested change
| Mypyc now has rudimentary support for `__new__` methods. | |
| Mypyc now has rudimentary support for user-defined `__new__` methods. |
| - Avoid duplicate work when checking boolean operations (Ivan Levkivskyi, PR [19515](https://github.com/python/mypy/pull/19515)) | ||
| - Optimize generic inference passes (Ivan Levkivskyi, PR [19501](https://github.com/python/mypy/pull/19501)) | ||
| - Speed up the default plugin (Jukka Lehtosalo, PR [19462](https://github.com/python/mypy/pull/19462)) | ||
| - Speed up the default plugin (Jukka Lehtosalo, PR [19385](https://github.com/python/mypy/pull/19385)) |
Member
There was a problem hiding this comment.
Maybe merge these two PR into single line, like few lines above?
KevinRK29
pushed a commit
that referenced
this pull request
Sep 11, 2025
Did various edits, added a few additional sections, and reordered some sections. (cherry picked from commit 73fa69e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did various edits, added a few additional sections, and reordered some sections.