|
2 | 2 |
|
3 | 3 | ## Next release
|
4 | 4 |
|
| 5 | +... |
| 6 | + |
| 7 | +## Mypy 1.15 (unreleased) |
| 8 | + |
| 9 | +We’ve just uploaded mypy 1.15 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)). |
| 10 | +Mypy is a static type checker for Python. This release includes new features and bug fixes. |
| 11 | +You can install it as follows: |
| 12 | + |
| 13 | + python3 -m pip install -U mypy |
| 14 | + |
| 15 | +You can read the full documentation for this release on [Read the Docs](http://mypy.readthedocs.io). |
| 16 | + |
5 | 17 | ### Performance improvements
|
6 | 18 |
|
7 | 19 | Mypy may be 5-30% faster. This improvement comes largely from tuning the performance of the
|
@@ -68,6 +80,111 @@ Support for this will be dropped in the first half of 2025!
|
68 | 80 |
|
69 | 81 | Contributed by Marc Mueller (PR [17492](https://github.com/python/mypy/pull/17492)).
|
70 | 82 |
|
| 83 | +### Mypyc Improvements |
| 84 | + |
| 85 | + * Fix `__init__` for classes with `@attr.s(slots=True)` (Advait Dixit, PR [18447](https://github.com/python/mypy/pull/18447)) |
| 86 | + * Report error for nested class instead of crashing (Valentin Stanciu, PR [18460](https://github.com/python/mypy/pull/18460)) |
| 87 | + * Fix `InitVar` for dataclasses (Advait Dixit, PR [18319](https://github.com/python/mypy/pull/18319)) |
| 88 | + * Remove unnecessary mypyc files from wheels (Marc Mueller, PR [18416](https://github.com/python/mypy/pull/18416)) |
| 89 | + * Get capsule pointer from module instead of `PyCapsule_Import` (Advait Dixit, PR [18286](https://github.com/python/mypy/pull/18286)) |
| 90 | + * Add lowered primitive for unsafe list get item op (Jukka Lehtosalo, PR [18136](https://github.com/python/mypy/pull/18136)) |
| 91 | + * Fix iteration over `NamedTuple` objects (Advait Dixit, PR [18254](https://github.com/python/mypy/pull/18254)) |
| 92 | + * Mark mypyc package with `py.typed` (bzoracler, PR [18253](https://github.com/python/mypy/pull/18253)) |
| 93 | + * Update docstrings of IR builder classes (Jukka Lehtosalo, PR [18246](https://github.com/python/mypy/pull/18246)) |
| 94 | + * Fix list index while checking for `Enum` class. (Advait Dixit, PR [18426](https://github.com/python/mypy/pull/18426)) |
| 95 | + * Update `pythoncapi_compat.h` (Marc Mueller, PR [18340](https://github.com/python/mypy/pull/18340)) |
| 96 | + |
| 97 | +### Stubgen Improvements |
| 98 | + |
| 99 | + * Improve dataclass init signatures (Marc Mueller, PR [18430](https://github.com/python/mypy/pull/18430)) |
| 100 | + * Preserve `dataclass_transform` decorator (Marc Mueller, PR [18418](https://github.com/python/mypy/pull/18418)) |
| 101 | + * Fix `UnpackType` for 3.11+ (Marc Mueller, PR [18421](https://github.com/python/mypy/pull/18421)) |
| 102 | + * Improve `self` annotations (Marc Mueller, PR [18420](https://github.com/python/mypy/pull/18420)) |
| 103 | + * Print `InspectError` traceback in stubgen `walk_packages` when verbose is specified (Gareth, PR [18224](https://github.com/python/mypy/pull/18224)) |
| 104 | + |
| 105 | +### Stubtest Improvements |
| 106 | + |
| 107 | + * Fix crash with numpy array default values (Ali Hamdan, PR [18353](https://github.com/python/mypy/pull/18353)) |
| 108 | + * Distinguish metaclass attributes from class attributes (Stephen Morton, PR [18314](https://github.com/python/mypy/pull/18314)) |
| 109 | + |
| 110 | +### Fixes to Crashes |
| 111 | + |
| 112 | + * Prevent crash with `Unpack` of a fixed tuple in PEP695 type alias (Stanislav Terliakov, PR [18451](https://github.com/python/mypy/pull/18451)) |
| 113 | + * Fix crash with `--cache-fine-grained --cache-dir=/dev/null` (Shantanu, PR [18457](https://github.com/python/mypy/pull/18457)) |
| 114 | + * Prevent crashing when `match` arms use name of existing callable (Stanislav Terliakov, PR [18449](https://github.com/python/mypy/pull/18449)) |
| 115 | + * Gracefully handle encoding errors when writing to stdout (Brian Schubert, PR [18292](https://github.com/python/mypy/pull/18292)) |
| 116 | + |
| 117 | +### Documentation Updates |
| 118 | + |
| 119 | + * Add `sphinx_inline_tabs` to docs (Marc Mueller, PR [18262](https://github.com/python/mypy/pull/18262)) |
| 120 | + * Document any `TYPE_CHECKING` name works (Shantanu, PR [18443](https://github.com/python/mypy/pull/18443)) |
| 121 | + * Update docs not to mention 3.8 where possible (sobolevn, PR [18455](https://github.com/python/mypy/pull/18455)) |
| 122 | + * Mention `ignore_errors` in exclude docs (Shantanu, PR [18412](https://github.com/python/mypy/pull/18412)) |
| 123 | + * Add `Self` misuse to common issues (Shantanu, PR [18261](https://github.com/python/mypy/pull/18261)) |
| 124 | + |
| 125 | +### Other Notable Fixes and Improvements |
| 126 | + |
| 127 | + * Fix literal context for ternary expressions (Ivan Levkivskyi, PR [18545](https://github.com/python/mypy/pull/18545)) |
| 128 | + * Ignore `dataclass.__replace__` LSP violations (Marc Mueller, PR [18464](https://github.com/python/mypy/pull/18464)) |
| 129 | + * Bind `self` to the class being defined when checking multiple inheritance (Stanislav Terliakov, PR [18465](https://github.com/python/mypy/pull/18465)) |
| 130 | + * Fix attribute type resolution with multiple inheritance (Stanislav Terliakov, PR [18415](https://github.com/python/mypy/pull/18415)) |
| 131 | + * Improve security of our GitHub Actions (sobolevn, PR [18413](https://github.com/python/mypy/pull/18413)) |
| 132 | + * Unwrap `type[Union[...]]` when solving typevar constraints (Stanislav Terliakov, PR [18266](https://github.com/python/mypy/pull/18266)) |
| 133 | + * Allow `Any` to match sequence patterns in match/case (Stanislav Terliakov, PR [18448](https://github.com/python/mypy/pull/18448)) |
| 134 | + * Avoid false `unreachable` and `redundant-expr` warnings in loops. (Christoph Tyralla, PR [18433](https://github.com/python/mypy/pull/18433)) |
| 135 | + * Fix parent generics mapping when overriding generic attribute with property (Stanislav Terliakov, PR [18441](https://github.com/python/mypy/pull/18441)) |
| 136 | + * Dedicated error code for explicit `Any` (Shantanu, PR [18398](https://github.com/python/mypy/pull/18398)) |
| 137 | + * Reject invalid `ParamSpec` locations (Stanislav Terliakov, PR [18278](https://github.com/python/mypy/pull/18278)) |
| 138 | + * Remove stubs no longer in typeshed (Shantanu, PR [18373](https://github.com/python/mypy/pull/18373)) |
| 139 | + * Allow inverting `--local-partial-types` (Shantanu, PR [18377](https://github.com/python/mypy/pull/18377)) |
| 140 | + * Allow to use `Final` and `ClassVar` after Python 3.13 (정승원, PR [18358](https://github.com/python/mypy/pull/18358)) |
| 141 | + * Update to include latest stubs in typeshed (Shantanu, PR [18366](https://github.com/python/mypy/pull/18366)) |
| 142 | + * Fix `--install-types` masking failure details (wyattscarpenter, PR [17485](https://github.com/python/mypy/pull/17485)) |
| 143 | + * Reject promotions when checking against protocols. (Christoph Tyralla, PR [18360](https://github.com/python/mypy/pull/18360)) |
| 144 | + * Don't erase type object args in diagnostics (Shantanu, PR [18352](https://github.com/python/mypy/pull/18352)) |
| 145 | + * Clarify status in `dmypy status` output (Kcornw, PR [18331](https://github.com/python/mypy/pull/18331)) |
| 146 | + * Disallow no-args generic aliases when using PEP 613 explicit aliases (Brian Schubert, PR [18173](https://github.com/python/mypy/pull/18173)) |
| 147 | + * Suppress errors for unreachable branches in conditional expressions (Brian Schubert, PR [18295](https://github.com/python/mypy/pull/18295)) |
| 148 | + * Do not allow `ClassVar` and `Final` in `TypedDict` and `NamedTuple` (sobolevn, PR [18281](https://github.com/python/mypy/pull/18281)) |
| 149 | + * Fail typecheck if not enough or too many types provided to `TypeAliasType` (bzoracler, PR [18308](https://github.com/python/mypy/pull/18308)) |
| 150 | + * Use more precise context for `TypedDict` plugin errors (Brian Schubert, PR [18293](https://github.com/python/mypy/pull/18293)) |
| 151 | + * Use more precise context for invalid type argument errors (Brian Schubert, PR [18290](https://github.com/python/mypy/pull/18290)) |
| 152 | + * Do not allow `type[]` to contain `Literal` types (sobolevn, PR [18276](https://github.com/python/mypy/pull/18276)) |
| 153 | + * Allow bytearray/bytes comparisons with --disable-bytearray-promotion (Jukka Lehtosalo, PR [18255](https://github.com/python/mypy/pull/18255)) |
| 154 | + * More LSP compatibility on arg names (Shantanu, PR [18363](https://github.com/python/mypy/pull/18363)) |
| 155 | + * Speed up `State.finish_passes` (Jukka Lehtosalo, PR [18302](https://github.com/python/mypy/pull/18302)) |
| 156 | + * Optimize type indirection visitor (Jukka Lehtosalo, PR [18298](https://github.com/python/mypy/pull/18298)) |
| 157 | + * Speed up SCC dependency inference (Jukka Lehtosalo, PR [18299](https://github.com/python/mypy/pull/18299)) |
| 158 | + |
| 159 | +### Acknowledgements |
| 160 | + |
| 161 | +Thanks to all mypy contributors who contributed to this release: |
| 162 | + |
| 163 | +Thanks to all mypy contributors who contributed to this release: |
| 164 | + |
| 165 | +- Advait Dixit |
| 166 | +- Ali Hamdan |
| 167 | +- Brian Schubert |
| 168 | +- bzoracler |
| 169 | +- Cameron Matsui |
| 170 | +- Christoph Tyralla |
| 171 | +- Gareth |
| 172 | +- Ivan Levkivskyi |
| 173 | +- Jukka Lehtosalo |
| 174 | +- Kcornw |
| 175 | +- Marc Mueller |
| 176 | +- Mikhail f. Shiryaev |
| 177 | +- Shantanu |
| 178 | +- sobolevn |
| 179 | +- Stanislav Terliakov |
| 180 | +- Stephen Morton |
| 181 | +- Valentin Stanciu |
| 182 | +- Viktor Szépe |
| 183 | +- wyattscarpenter |
| 184 | +- 정승원 |
| 185 | + |
| 186 | +I’d also like to thank my employer, Dropbox, for supporting mypy development. |
| 187 | + |
71 | 188 | ## Mypy 1.14
|
72 | 189 |
|
73 | 190 | We’ve just uploaded mypy 1.14 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)).
|
|
0 commit comments