From 257809111a862c31ea9b5c8ed3fca19d7782d4da Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 7 Oct 2024 13:18:35 +0100 Subject: [PATCH 1/8] Initial CHANGELOG for 1.12 --- CHANGELOG.md | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9632cb39a8b1..f24e2e100533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,153 @@ ## Next release +## Mypy 1.12 + +We’ve just uploaded mypy 1.12 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)). Mypy is a static type +checker for Python. This release includes new features, performance improvements and bug fixes. +You can install it as follows: + + python3 -m pip install -U mypy + +You can read the full documentation for this release on [Read the Docs](http://mypy.readthedocs.io). + +### Support Python 3.12 Syntax for Generics (PEP 695) + +Support for the new type parameter syntax introduced in 3.12 is now enabled by default. + +These improvements are included: + + * [PEP 695] Further documentation updates (Jukka Lehtosalo, PR [17826](https://github.com/python/mypy/pull/17826)) + * [PEP 695] Document Python 3.12 type parameter syntax (Jukka Lehtosalo, PR [17816](https://github.com/python/mypy/pull/17816)) + * [PEP 695] Allow Self return types with contravariance (Jukka Lehtosalo, PR [17786](https://github.com/python/mypy/pull/17786)) + * [PEP 695] Enable new type parameter syntax by default (Jukka Lehtosalo, PR [17798](https://github.com/python/mypy/pull/17798)) + * [PEP 695] Generate error if new-style type alias used as base class (Jukka Lehtosalo, PR [17789](https://github.com/python/mypy/pull/17789)) + * [PEP 695] Inherit variance if base class has explicit variance (Jukka Lehtosalo, PR [17787](https://github.com/python/mypy/pull/17787)) + * [PEP 695] Fix crash on invalid type var reference (Jukka Lehtosalo, PR [17788](https://github.com/python/mypy/pull/17788)) + * [PEP 695] Fix covariance of frozen dataclasses (Jukka Lehtosalo, PR [17783](https://github.com/python/mypy/pull/17783)) + * [PEP 695] Allow covariance with attribute that has "_" name prefix (Jukka Lehtosalo, PR [17782](https://github.com/python/mypy/pull/17782)) + * [PEP 695] Support Annotated[...] in new-style type aliases (Jukka Lehtosalo, PR [17777](https://github.com/python/mypy/pull/17777)) + * [PEP 695] Fix nested generic classes (Jukka Lehtosalo, PR [17776](https://github.com/python/mypy/pull/17776)) + * PEP 695: Add detection and error reporting for the use of incorrect expressions within the scope of a type parameter and a type alias (Kirill Podoprigora, PR [17560](https://github.com/python/mypy/pull/17560)) + +### Basic Support for Python 3.13 + +This release adds compiled binaries for Python 3.13 and partial support for Python 3.13 +features. Mypyc also now supports Python 3.13. + +These features are supported: + * Various stdlib updates (through typeshed stub improvements) + * `typing.ReadOnly` (see below for more) + * `typing.TypeIs` (support was added in mypy 1.10) + * Type parameter defaults when using the legacy syntax ([PEP 695](https://peps.python.org/pep-0696/)) + +These features are not supported yet: + * `warnings.deprecated` ([PEP 702](https://peps.python.org/pep-0702/)) + * Type parameter defaults when using Python 3.12 for type parameters + +### Mypyc Support for Python 3.13 + +Mypyc now supports Python 3.13. Full list of changes: + + * Add additional includes for Python 3.13 (Marc Mueller, PR [17506](https://github.com/python/mypy/pull/17506)) + * Add another include for Python 3.13 (Marc Mueller, PR [17509](https://github.com/python/mypy/pull/17509)) + * Fix ManagedDict functions for Python 3.13 (Marc Mueller, PR [17507](https://github.com/python/mypy/pull/17507)) + * Update mypyc test output for Python 3.13 (Marc Mueller, PR [17508](https://github.com/python/mypy/pull/17508)) + * Fix `PyUnicode` functions for Python 3.13 (Marc Mueller, PR [17504](https://github.com/python/mypy/pull/17504)) + * Fix `_PyObject_LookupAttrId` for Python 3.13 (Marc Mueller, PR [17505](https://github.com/python/mypy/pull/17505)) + * Fix `_PyList_Extend` for Python 3.13 (Marc Mueller, PR [17503](https://github.com/python/mypy/pull/17503)) + * Fix `gen_is_coroutine` for Python 3.13 (Marc Mueller, PR [17501](https://github.com/python/mypy/pull/17501)) + * Fix `_PyObject_FastCall` for Python 3.13 (Marc Mueller, PR [17502](https://github.com/python/mypy/pull/17502)) + * Avoid uses of `_PyObject_CallMethodOneArg` on 3.13 (Jukka Lehtosalo, PR [17526](https://github.com/python/mypy/pull/17526)) + * Don't rely on `_PyType_CalculateMetaclass` on 3.13 (Jukka Lehtosalo, PR [17525](https://github.com/python/mypy/pull/17525)) + * Don't use `_PyUnicode_FastCopyCharacters` on 3.13 (Jukka Lehtosalo, PR [17524](https://github.com/python/mypy/pull/17524)) + * Don't use `_PyUnicode_EQ` on 3.13, as it's no longer exported (Jukka Lehtosalo, PR [17523](https://github.com/python/mypy/pull/17523)) + +### ReadOnly support TypedDict + + * Add `ReadOnly` support for TypedDicts (sobolevn, PR [17644](https://github.com/python/mypy/pull/17644)) + +### Other Notables Fixes and Improvements + + * [PEP 696] Report error if using unsupported type parameter defaults (Jukka Lehtosalo, PR [17876](https://github.com/python/mypy/pull/17876)) + * Fix re-processing cross-reference when node kind changes (Ivan Levkivskyi, PR [17883](https://github.com/python/mypy/pull/17883)) + * Don't consider None vs IntEnum comparison ambiguous (Jukka Lehtosalo, PR [17877](https://github.com/python/mypy/pull/17877)) + * Fix narrowing of IntEnum and StrEnum types (Jukka Lehtosalo, PR [17874](https://github.com/python/mypy/pull/17874)) + * Filter overload items based on self type during type inference (Jukka Lehtosalo, PR [17873](https://github.com/python/mypy/pull/17873)) + * Fix typos in .github/worflows/test.yml (Jukka Lehtosalo, PR [17867](https://github.com/python/mypy/pull/17867)) + * Don't use equality to narrow when value is IntEnum/StrEnum (Jukka Lehtosalo, PR [17866](https://github.com/python/mypy/pull/17866)) + * Revert "Narrow based on collection containment (#17344)" (Jukka Lehtosalo, PR [17865](https://github.com/python/mypy/pull/17865)) + * .git-blame-ignore-revs: add #15059 and #16847 (Brian Schubert, PR [17862](https://github.com/python/mypy/pull/17862)) + * Enable negative narrowing of Union TypeVar upper bounds (Brian Schubert, PR [17850](https://github.com/python/mypy/pull/17850)) + * Fix tests on latest Python 3.13 (and 3.12) (Shantanu, PR [17849](https://github.com/python/mypy/pull/17849)) + * Fix get_member_expr_fullname returning strings with embedded "None" (Brian Schubert, PR [17848](https://github.com/python/mypy/pull/17848)) + * Avoid type size explosion when expanding types (Jukka Lehtosalo, PR [17842](https://github.com/python/mypy/pull/17842)) + * Document `--output=json` CLI option (Edgar Ramírez Mondragón, PR [17611](https://github.com/python/mypy/pull/17611)) + * Fix negative narrowing of tuples in match statement (Brian Schubert, PR [17817](https://github.com/python/mypy/pull/17817)) + * Make "X | Y" union syntax more prominent in documentation (Jukka Lehtosalo, PR [17835](https://github.com/python/mypy/pull/17835)) + * Update various references to deprecated type aliases in docs (Jukka Lehtosalo, PR [17829](https://github.com/python/mypy/pull/17829)) + * Discuss upper bounds before self types in documentation (Jukka Lehtosalo, PR [17827](https://github.com/python/mypy/pull/17827)) + * Narrow falsey str/bytes/int to literal type (Brian Schubert, PR [17818](https://github.com/python/mypy/pull/17818)) + * Test against latest Python 3.13, make testing 3.14 easy (Shantanu, PR [17812](https://github.com/python/mypy/pull/17812)) + * Reject ParamSpec-typed callables calls with insufficient arguments (Stanislav Terliakov, PR [17323](https://github.com/python/mypy/pull/17323)) + * Copyedit final_attrs.rst (Michael I Chen, PR [17813](https://github.com/python/mypy/pull/17813)) + * Fix crash when passing too many type arguments to generic base class accepting single ParamSpec (Brian Schubert, PR [17770](https://github.com/python/mypy/pull/17770)) + * Fix TypeVar upper bounds sometimes not being displayed in pretty callables (Brian Schubert, PR [17802](https://github.com/python/mypy/pull/17802)) + * Added error code for overlapping function signatures (Katrina Connors, PR [17597](https://github.com/python/mypy/pull/17597)) + * Check for `truthy-bool` in `not ...` unary expressions (sobolevn, PR [17773](https://github.com/python/mypy/pull/17773)) + * Add missing lines-covered and lines-valid attributes (Soubhik Kumar Mitra, PR [17738](https://github.com/python/mypy/pull/17738)) + * Make changelog visible in mypy documentation (quinn-sasha, PR [17742](https://github.com/python/mypy/pull/17742)) + * stubgen: Use `Generator` type var defaults (Sebastian Rittau, PR [17670](https://github.com/python/mypy/pull/17670)) + * Use newer Python in docs build (Shantanu, PR [17747](https://github.com/python/mypy/pull/17747)) + * [nit] conf.py: annotate the type, instead of ignoring the error (wyattscarpenter, PR [17727](https://github.com/python/mypy/pull/17727)) + * Fix another crash scenario on recursive tuple types (Ivan Levkivskyi, PR [17708](https://github.com/python/mypy/pull/17708)) + * Add optional stderr result to `run_stubtest` in tests (sobolevn, PR [17636](https://github.com/python/mypy/pull/17636)) + * [stubgen] Fix crash on literal class-level keywords (sobolevn, PR [17663](https://github.com/python/mypy/pull/17663)) + * Stubgen add `--version` (sobolevn, PR [17662](https://github.com/python/mypy/pull/17662)) + * stubtest: Add support for cached_property (Ali Hamdan, PR [17626](https://github.com/python/mypy/pull/17626)) + * Resolve TypeVar upper bounds in functools.partial (Shantanu, PR [17660](https://github.com/python/mypy/pull/17660)) + * Add `enable_incomplete_feature` validation to `stubtest` (sobolevn, PR [17635](https://github.com/python/mypy/pull/17635)) + * Fix typo in error_code_list.rst (sobolevn, PR [17645](https://github.com/python/mypy/pull/17645)) + * Always reset binder when checking deferred nodes (Ivan Levkivskyi, PR [17643](https://github.com/python/mypy/pull/17643)) + * Fix crash on a callable attribute with single unpack (Ivan Levkivskyi, PR [17641](https://github.com/python/mypy/pull/17641)) + * List all incomplete features in `--enable-incomplete-feature` docs (sobolevn, PR [17633](https://github.com/python/mypy/pull/17633)) + * Fix `stubgen --no-analysis/--parse-only` docs (sobolevn, PR [17632](https://github.com/python/mypy/pull/17632)) + * Fix error code handling in `stubtest` with `--mypy-config-file` (sobolevn, PR [17629](https://github.com/python/mypy/pull/17629)) + * fix: Mismatched signature between checker plugin API and implementation (bzoracler, PR [17343](https://github.com/python/mypy/pull/17343)) + * Narrow based on collection containment (Jordandev678, PR [17344](https://github.com/python/mypy/pull/17344)) + * Remove the explicit setting of a pygments theme (Pradyun Gedam, PR [17571](https://github.com/python/mypy/pull/17571)) + * Bump setuptools from 68.2.2 to 70.0.0 (dependabot[bot], PR [17533](https://github.com/python/mypy/pull/17533)) + * Indexing a type also produces a GenericAlias (Shantanu, PR [17546](https://github.com/python/mypy/pull/17546)) + * Experimental: allow inline/anonymous TypedDicts (Ivan Levkivskyi, PR [17457](https://github.com/python/mypy/pull/17457)) + * Fix crash on self-type in callable protocol (Ivan Levkivskyi, PR [17499](https://github.com/python/mypy/pull/17499)) + * Fix crash on NamedTuple with method and error in function (Ivan Levkivskyi, PR [17498](https://github.com/python/mypy/pull/17498)) + * Fix cross-variable type-narrowing example (InSync, PR [17488](https://github.com/python/mypy/pull/17488)) + * Run Python 3.13 tests in CI (with failures allowed) (Shantanu, PR [17484](https://github.com/python/mypy/pull/17484)) + * Revert "Have namedtuple `__replace__` return `Self`" (Ivan Levkivskyi, PR [17496](https://github.com/python/mypy/pull/17496)) + * Refactor: remove temporary `def` from `semanal_classprop.check_protocol_status` (sobolevn, PR [17486](https://github.com/python/mypy/pull/17486)) + * Have namedtuple `__replace__` return `Self` (Max Muoto, PR [17475](https://github.com/python/mypy/pull/17475)) + * Add `__replace__` for dataclasses in 3.13 (Max Muoto, PR [17469](https://github.com/python/mypy/pull/17469)) + * Fix help message for --no-namespace-packages. (Raphael Krupinski, PR [17472](https://github.com/python/mypy/pull/17472)) + * Infer unions for ternary expressions (Ivan Levkivskyi, PR [17427](https://github.com/python/mypy/pull/17427)) + * Use Python 3.12 for mypy_primer (Shantanu, PR [17456](https://github.com/python/mypy/pull/17456)) + * Fix typechecking for async generators (Danny Yang, PR [17452](https://github.com/python/mypy/pull/17452)) + * Fix strict optional handling in attrs plugin (Ivan Levkivskyi, PR [17451](https://github.com/python/mypy/pull/17451)) + * Include keyword only args when generating signatures in stubgenc (Eric Mark Martin, PR [17448](https://github.com/python/mypy/pull/17448)) + * Add Literal support for docstrings (Michael Carlstrom, PR [17441](https://github.com/python/mypy/pull/17441)) + * Allow mixing ParamSpec and TypeVarTuple in Generic (Ivan Levkivskyi, PR [17450](https://github.com/python/mypy/pull/17450)) + * Fix typo in `error_code_list2.rst` (InSync, PR [17443](https://github.com/python/mypy/pull/17443)) + +### Typeshed Updates + +Please see [git log](https://github.com/python/typeshed/commits/main?after=91a58b07cdd807b1d965e04ba85af2adab8bf924+0&branch=main&path=stdlib) for full list of standard library typeshed stub changes. + +### Acknowledgements +Thanks to all mypy contributors who contributed to this release: + +- TODO + +I’d also like to thank my employer, Dropbox, for supporting mypy development. + ## Mypy 1.11 From 666ea4de45491078c7385cfed938415d7d5ea202 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 7 Oct 2024 13:51:42 +0100 Subject: [PATCH 2/8] Changelog updates --- CHANGELOG.md | 158 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f24e2e100533..31c86355bbcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,22 +14,24 @@ You can read the full documentation for this release on [Read the Docs](http://m ### Support Python 3.12 Syntax for Generics (PEP 695) -Support for the new type parameter syntax introduced in 3.12 is now enabled by default. +Support for the new type parameter syntax introduced in 3.12 is now enabled by default, +documented, and no longer experimental. It was available through a feature flag in +mypy 1.11 as an experimental feature. These improvements are included: - * [PEP 695] Further documentation updates (Jukka Lehtosalo, PR [17826](https://github.com/python/mypy/pull/17826)) - * [PEP 695] Document Python 3.12 type parameter syntax (Jukka Lehtosalo, PR [17816](https://github.com/python/mypy/pull/17816)) - * [PEP 695] Allow Self return types with contravariance (Jukka Lehtosalo, PR [17786](https://github.com/python/mypy/pull/17786)) - * [PEP 695] Enable new type parameter syntax by default (Jukka Lehtosalo, PR [17798](https://github.com/python/mypy/pull/17798)) - * [PEP 695] Generate error if new-style type alias used as base class (Jukka Lehtosalo, PR [17789](https://github.com/python/mypy/pull/17789)) - * [PEP 695] Inherit variance if base class has explicit variance (Jukka Lehtosalo, PR [17787](https://github.com/python/mypy/pull/17787)) - * [PEP 695] Fix crash on invalid type var reference (Jukka Lehtosalo, PR [17788](https://github.com/python/mypy/pull/17788)) - * [PEP 695] Fix covariance of frozen dataclasses (Jukka Lehtosalo, PR [17783](https://github.com/python/mypy/pull/17783)) - * [PEP 695] Allow covariance with attribute that has "_" name prefix (Jukka Lehtosalo, PR [17782](https://github.com/python/mypy/pull/17782)) - * [PEP 695] Support Annotated[...] in new-style type aliases (Jukka Lehtosalo, PR [17777](https://github.com/python/mypy/pull/17777)) - * [PEP 695] Fix nested generic classes (Jukka Lehtosalo, PR [17776](https://github.com/python/mypy/pull/17776)) - * PEP 695: Add detection and error reporting for the use of incorrect expressions within the scope of a type parameter and a type alias (Kirill Podoprigora, PR [17560](https://github.com/python/mypy/pull/17560)) + * Document Python 3.12 type parameter syntax (Jukka Lehtosalo, PR [17816](https://github.com/python/mypy/pull/17816)) + * Further documentation updates (Jukka Lehtosalo, PR [17826](https://github.com/python/mypy/pull/17826)) + * Allow Self return types with contravariance (Jukka Lehtosalo, PR [17786](https://github.com/python/mypy/pull/17786)) + * Enable new type parameter syntax by default (Jukka Lehtosalo, PR [17798](https://github.com/python/mypy/pull/17798)) + * Generate error if new-style type alias used as base class (Jukka Lehtosalo, PR [17789](https://github.com/python/mypy/pull/17789)) + * Inherit variance if base class has explicit variance (Jukka Lehtosalo, PR [17787](https://github.com/python/mypy/pull/17787)) + * Fix crash on invalid type var reference (Jukka Lehtosalo, PR [17788](https://github.com/python/mypy/pull/17788)) + * Fix covariance of frozen dataclasses (Jukka Lehtosalo, PR [17783](https://github.com/python/mypy/pull/17783)) + * Allow covariance with attribute that has "`_`" name prefix (Jukka Lehtosalo, PR [17782](https://github.com/python/mypy/pull/17782)) + * Support `Annotated[...]` in new-style type aliases (Jukka Lehtosalo, PR [17777](https://github.com/python/mypy/pull/17777)) + * Fix nested generic classes (Jukka Lehtosalo, PR [17776](https://github.com/python/mypy/pull/17776)) + * Add detection and error reporting for the use of incorrect expressions within the scope of a type parameter and a type alias (Kirill Podoprigora, PR [17560](https://github.com/python/mypy/pull/17560)) ### Basic Support for Python 3.13 @@ -37,18 +39,21 @@ This release adds compiled binaries for Python 3.13 and partial support for Pyth features. Mypyc also now supports Python 3.13. These features are supported: - * Various stdlib updates (through typeshed stub improvements) + * Various new stdlib features and changes (through typeshed stub improvements) * `typing.ReadOnly` (see below for more) * `typing.TypeIs` (support was added in mypy 1.10) * Type parameter defaults when using the legacy syntax ([PEP 695](https://peps.python.org/pep-0696/)) These features are not supported yet: * `warnings.deprecated` ([PEP 702](https://peps.python.org/pep-0702/)) - * Type parameter defaults when using Python 3.12 for type parameters + * Type parameter defaults when using Python 3.12 type parameter syntax ### Mypyc Support for Python 3.13 -Mypyc now supports Python 3.13. Full list of changes: +Mypyc now supports Python 3.13. This was contributed by Marc Mueller, with additional +fixes by Jukka Lehtosalo. Free threaded Python 3.13 builds are not supported yet. + +List of changes: * Add additional includes for Python 3.13 (Marc Mueller, PR [17506](https://github.com/python/mypy/pull/17506)) * Add another include for Python 3.13 (Marc Mueller, PR [17509](https://github.com/python/mypy/pull/17509)) @@ -64,79 +69,114 @@ Mypyc now supports Python 3.13. Full list of changes: * Don't use `_PyUnicode_FastCopyCharacters` on 3.13 (Jukka Lehtosalo, PR [17524](https://github.com/python/mypy/pull/17524)) * Don't use `_PyUnicode_EQ` on 3.13, as it's no longer exported (Jukka Lehtosalo, PR [17523](https://github.com/python/mypy/pull/17523)) -### ReadOnly support TypedDict +### Inferring Unions for Conditional Expressions + +Mypy now always tries to infer a union type for a conditional expression. This results in +more precise inferred types and lets mypy detect more issues. + +Notably, if one of the operands has type `Any`, the type of a conditional expression is +now ` | Any`. Previously the inferred type was just `Any`. Example where this is +relevant: + +```python +from typing import Any + +def func(a: Any, b: bool) -> None: + x = a if b else None + # Type of x is "Any | None" + print(x.y) # Error: None has no attribute "y" +``` + +This feature was contributed by Ivan Levkivskyi (PR [17427](https://github.com/python/mypy/pull/17427)). + +### ReadOnly Support for TypedDict * Add `ReadOnly` support for TypedDicts (sobolevn, PR [17644](https://github.com/python/mypy/pull/17644)) +### Python 3.8 End of Life Approaching + +We are planning to drop support for Python 3.8 in the next mypy feature release or the +one after that. Python 3.8 reaches end of life in Octoboer 2024. + +### Planned Changes to Defaults + +We are planning to enable `--local-partial-types` by default in mypy 2.0. This will +often require at least minor code changes. This option is implicitly enabled by mypy +daemon, so this makes the behavior of daemon and non-daemon modes consistent. + +We recommend that mypy users start using local partial types soon (or to explicitly disable +them) to prepare for the change. + +This can also be configured in a mypy configuration file: + +``` +local_partial_types = True +``` + +For more information, refer to the +[documentation](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-local-partial-types). + +### Documentation Updates + +Mypy documentation now uses modern syntax variants and imports in many examples. Some +examples no longer work on Python 3.8, which is the earliest Python version that mypy supports. + + * Document `--output=json` CLI option (Edgar Ramírez Mondragón, PR [17611](https://github.com/python/mypy/pull/17611)) + * Update various references to deprecated type aliases in docs (Jukka Lehtosalo, PR [17829](https://github.com/python/mypy/pull/17829)) + * Make "X | Y" union syntax more prominent in documentation (Jukka Lehtosalo, PR [17835](https://github.com/python/mypy/pull/17835)) + * Discuss upper bounds before self types in documentation (Jukka Lehtosalo, PR [17827](https://github.com/python/mypy/pull/17827)) + * Make changelog visible in mypy documentation (quinn-sasha, PR [17742](https://github.com/python/mypy/pull/17742)) + * List all incomplete features in `--enable-incomplete-feature` docs (sobolevn, PR [17633](https://github.com/python/mypy/pull/17633)) + * Remove the explicit setting of a pygments theme (Pradyun Gedam, PR [17571](https://github.com/python/mypy/pull/17571)) + +### Stubgen Improvements + + * Fix crash on literal class-level keywords (sobolevn, PR [17663](https://github.com/python/mypy/pull/17663)) + * Stubgen add `--version` (sobolevn, PR [17662](https://github.com/python/mypy/pull/17662)) + * Fix `stubgen --no-analysis/--parse-only` docs (sobolevn, PR [17632](https://github.com/python/mypy/pull/17632)) + * Include keyword only args when generating signatures in stubgenc (Eric Mark Martin, PR [17448](https://github.com/python/mypy/pull/17448)) + * Add Literal support for docstrings (Michael Carlstrom, PR [17441](https://github.com/python/mypy/pull/17441)) + * Use `Generator` type var defaults (Sebastian Rittau, PR [17670](https://github.com/python/mypy/pull/17670)) + +### Stubtest Improvements + * Add support for `cached_property` (Ali Hamdan, PR [17626](https://github.com/python/mypy/pull/17626)) + * Add `enable_incomplete_feature` validation to `stubtest` (sobolevn, PR [17635](https://github.com/python/mypy/pull/17635)) + * Fix error code handling in `stubtest` with `--mypy-config-file` (sobolevn, PR [17629](https://github.com/python/mypy/pull/17629)) + ### Other Notables Fixes and Improvements - * [PEP 696] Report error if using unsupported type parameter defaults (Jukka Lehtosalo, PR [17876](https://github.com/python/mypy/pull/17876)) - * Fix re-processing cross-reference when node kind changes (Ivan Levkivskyi, PR [17883](https://github.com/python/mypy/pull/17883)) + * Report error if using unsupported type parameter defaults (Jukka Lehtosalo, PR [17876](https://github.com/python/mypy/pull/17876)) + * Fix re-processing cross-reference in mypy daemon when node kind changes (Ivan Levkivskyi, PR [17883](https://github.com/python/mypy/pull/17883)) + * Don't use equality to narrow when value is IntEnum/StrEnum (Jukka Lehtosalo, PR [17866](https://github.com/python/mypy/pull/17866)) * Don't consider None vs IntEnum comparison ambiguous (Jukka Lehtosalo, PR [17877](https://github.com/python/mypy/pull/17877)) * Fix narrowing of IntEnum and StrEnum types (Jukka Lehtosalo, PR [17874](https://github.com/python/mypy/pull/17874)) * Filter overload items based on self type during type inference (Jukka Lehtosalo, PR [17873](https://github.com/python/mypy/pull/17873)) - * Fix typos in .github/worflows/test.yml (Jukka Lehtosalo, PR [17867](https://github.com/python/mypy/pull/17867)) - * Don't use equality to narrow when value is IntEnum/StrEnum (Jukka Lehtosalo, PR [17866](https://github.com/python/mypy/pull/17866)) - * Revert "Narrow based on collection containment (#17344)" (Jukka Lehtosalo, PR [17865](https://github.com/python/mypy/pull/17865)) - * .git-blame-ignore-revs: add #15059 and #16847 (Brian Schubert, PR [17862](https://github.com/python/mypy/pull/17862)) - * Enable negative narrowing of Union TypeVar upper bounds (Brian Schubert, PR [17850](https://github.com/python/mypy/pull/17850)) - * Fix tests on latest Python 3.13 (and 3.12) (Shantanu, PR [17849](https://github.com/python/mypy/pull/17849)) + * Enable negative narrowing of union TypeVar upper bounds (Brian Schubert, PR [17850](https://github.com/python/mypy/pull/17850)) * Fix get_member_expr_fullname returning strings with embedded "None" (Brian Schubert, PR [17848](https://github.com/python/mypy/pull/17848)) * Avoid type size explosion when expanding types (Jukka Lehtosalo, PR [17842](https://github.com/python/mypy/pull/17842)) - * Document `--output=json` CLI option (Edgar Ramírez Mondragón, PR [17611](https://github.com/python/mypy/pull/17611)) * Fix negative narrowing of tuples in match statement (Brian Schubert, PR [17817](https://github.com/python/mypy/pull/17817)) - * Make "X | Y" union syntax more prominent in documentation (Jukka Lehtosalo, PR [17835](https://github.com/python/mypy/pull/17835)) - * Update various references to deprecated type aliases in docs (Jukka Lehtosalo, PR [17829](https://github.com/python/mypy/pull/17829)) - * Discuss upper bounds before self types in documentation (Jukka Lehtosalo, PR [17827](https://github.com/python/mypy/pull/17827)) * Narrow falsey str/bytes/int to literal type (Brian Schubert, PR [17818](https://github.com/python/mypy/pull/17818)) * Test against latest Python 3.13, make testing 3.14 easy (Shantanu, PR [17812](https://github.com/python/mypy/pull/17812)) * Reject ParamSpec-typed callables calls with insufficient arguments (Stanislav Terliakov, PR [17323](https://github.com/python/mypy/pull/17323)) - * Copyedit final_attrs.rst (Michael I Chen, PR [17813](https://github.com/python/mypy/pull/17813)) * Fix crash when passing too many type arguments to generic base class accepting single ParamSpec (Brian Schubert, PR [17770](https://github.com/python/mypy/pull/17770)) * Fix TypeVar upper bounds sometimes not being displayed in pretty callables (Brian Schubert, PR [17802](https://github.com/python/mypy/pull/17802)) * Added error code for overlapping function signatures (Katrina Connors, PR [17597](https://github.com/python/mypy/pull/17597)) * Check for `truthy-bool` in `not ...` unary expressions (sobolevn, PR [17773](https://github.com/python/mypy/pull/17773)) * Add missing lines-covered and lines-valid attributes (Soubhik Kumar Mitra, PR [17738](https://github.com/python/mypy/pull/17738)) - * Make changelog visible in mypy documentation (quinn-sasha, PR [17742](https://github.com/python/mypy/pull/17742)) - * stubgen: Use `Generator` type var defaults (Sebastian Rittau, PR [17670](https://github.com/python/mypy/pull/17670)) - * Use newer Python in docs build (Shantanu, PR [17747](https://github.com/python/mypy/pull/17747)) - * [nit] conf.py: annotate the type, instead of ignoring the error (wyattscarpenter, PR [17727](https://github.com/python/mypy/pull/17727)) * Fix another crash scenario on recursive tuple types (Ivan Levkivskyi, PR [17708](https://github.com/python/mypy/pull/17708)) - * Add optional stderr result to `run_stubtest` in tests (sobolevn, PR [17636](https://github.com/python/mypy/pull/17636)) - * [stubgen] Fix crash on literal class-level keywords (sobolevn, PR [17663](https://github.com/python/mypy/pull/17663)) - * Stubgen add `--version` (sobolevn, PR [17662](https://github.com/python/mypy/pull/17662)) - * stubtest: Add support for cached_property (Ali Hamdan, PR [17626](https://github.com/python/mypy/pull/17626)) - * Resolve TypeVar upper bounds in functools.partial (Shantanu, PR [17660](https://github.com/python/mypy/pull/17660)) - * Add `enable_incomplete_feature` validation to `stubtest` (sobolevn, PR [17635](https://github.com/python/mypy/pull/17635)) - * Fix typo in error_code_list.rst (sobolevn, PR [17645](https://github.com/python/mypy/pull/17645)) + * Resolve TypeVar upper bounds in `functools.partial` (Shantanu, PR [17660](https://github.com/python/mypy/pull/17660)) * Always reset binder when checking deferred nodes (Ivan Levkivskyi, PR [17643](https://github.com/python/mypy/pull/17643)) * Fix crash on a callable attribute with single unpack (Ivan Levkivskyi, PR [17641](https://github.com/python/mypy/pull/17641)) - * List all incomplete features in `--enable-incomplete-feature` docs (sobolevn, PR [17633](https://github.com/python/mypy/pull/17633)) - * Fix `stubgen --no-analysis/--parse-only` docs (sobolevn, PR [17632](https://github.com/python/mypy/pull/17632)) - * Fix error code handling in `stubtest` with `--mypy-config-file` (sobolevn, PR [17629](https://github.com/python/mypy/pull/17629)) - * fix: Mismatched signature between checker plugin API and implementation (bzoracler, PR [17343](https://github.com/python/mypy/pull/17343)) - * Narrow based on collection containment (Jordandev678, PR [17344](https://github.com/python/mypy/pull/17344)) - * Remove the explicit setting of a pygments theme (Pradyun Gedam, PR [17571](https://github.com/python/mypy/pull/17571)) - * Bump setuptools from 68.2.2 to 70.0.0 (dependabot[bot], PR [17533](https://github.com/python/mypy/pull/17533)) + * Fix mismatched signature between checker plugin API and implementation (bzoracler, PR [17343](https://github.com/python/mypy/pull/17343)) * Indexing a type also produces a GenericAlias (Shantanu, PR [17546](https://github.com/python/mypy/pull/17546)) * Experimental: allow inline/anonymous TypedDicts (Ivan Levkivskyi, PR [17457](https://github.com/python/mypy/pull/17457)) * Fix crash on self-type in callable protocol (Ivan Levkivskyi, PR [17499](https://github.com/python/mypy/pull/17499)) * Fix crash on NamedTuple with method and error in function (Ivan Levkivskyi, PR [17498](https://github.com/python/mypy/pull/17498)) - * Fix cross-variable type-narrowing example (InSync, PR [17488](https://github.com/python/mypy/pull/17488)) - * Run Python 3.13 tests in CI (with failures allowed) (Shantanu, PR [17484](https://github.com/python/mypy/pull/17484)) - * Revert "Have namedtuple `__replace__` return `Self`" (Ivan Levkivskyi, PR [17496](https://github.com/python/mypy/pull/17496)) - * Refactor: remove temporary `def` from `semanal_classprop.check_protocol_status` (sobolevn, PR [17486](https://github.com/python/mypy/pull/17486)) - * Have namedtuple `__replace__` return `Self` (Max Muoto, PR [17475](https://github.com/python/mypy/pull/17475)) * Add `__replace__` for dataclasses in 3.13 (Max Muoto, PR [17469](https://github.com/python/mypy/pull/17469)) - * Fix help message for --no-namespace-packages. (Raphael Krupinski, PR [17472](https://github.com/python/mypy/pull/17472)) - * Infer unions for ternary expressions (Ivan Levkivskyi, PR [17427](https://github.com/python/mypy/pull/17427)) - * Use Python 3.12 for mypy_primer (Shantanu, PR [17456](https://github.com/python/mypy/pull/17456)) + * Fix help message for `--no-namespace-packages` (Raphael Krupinski, PR [17472](https://github.com/python/mypy/pull/17472)) * Fix typechecking for async generators (Danny Yang, PR [17452](https://github.com/python/mypy/pull/17452)) * Fix strict optional handling in attrs plugin (Ivan Levkivskyi, PR [17451](https://github.com/python/mypy/pull/17451)) - * Include keyword only args when generating signatures in stubgenc (Eric Mark Martin, PR [17448](https://github.com/python/mypy/pull/17448)) - * Add Literal support for docstrings (Michael Carlstrom, PR [17441](https://github.com/python/mypy/pull/17441)) * Allow mixing ParamSpec and TypeVarTuple in Generic (Ivan Levkivskyi, PR [17450](https://github.com/python/mypy/pull/17450)) - * Fix typo in `error_code_list2.rst` (InSync, PR [17443](https://github.com/python/mypy/pull/17443)) ### Typeshed Updates From 3dc7340aa0ec2eb68e45c050b30ac4daa13d8dc0 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 7 Oct 2024 14:58:12 +0100 Subject: [PATCH 3/8] Changelog updates --- CHANGELOG.md | 91 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 79 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c86355bbcc..5b43cad6a055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,10 +14,32 @@ You can read the full documentation for this release on [Read the Docs](http://m ### Support Python 3.12 Syntax for Generics (PEP 695) -Support for the new type parameter syntax introduced in 3.12 is now enabled by default, +Support for the new type parameter syntax introduced in Python 3.12 is now enabled by default, documented, and no longer experimental. It was available through a feature flag in mypy 1.11 as an experimental feature. +This example demonstrates the new syntax: + +```python +# Generic function +def f[T](x: T) -> T: ... + +reveal_type(f(1)) # Revealed type is 'int' + +# Generic class +class C[T]: + def __init__(self, x: T) -> None: + self.x = x + +c = C('a') +reveal_type(c.x) # Revealed type is 'str' + +# Type alias +type A[T] = C[list[T]] +``` + +For more information, refer to the [documentation](https://mypy.readthedocs.io/en/latest/generics.html). + These improvements are included: * Document Python 3.12 type parameter syntax (Jukka Lehtosalo, PR [17816](https://github.com/python/mypy/pull/17816)) @@ -35,14 +57,14 @@ These improvements are included: ### Basic Support for Python 3.13 -This release adds compiled binaries for Python 3.13 and partial support for Python 3.13 -features. Mypyc also now supports Python 3.13. +This release adds partial support for Python 3.13 features and compiled binaries for +Python 3.13. Mypyc now also supports Python 3.13. -These features are supported: +In particular, these features are supported: * Various new stdlib features and changes (through typeshed stub improvements) * `typing.ReadOnly` (see below for more) - * `typing.TypeIs` (support was added in mypy 1.10) - * Type parameter defaults when using the legacy syntax ([PEP 695](https://peps.python.org/pep-0696/)) + * `typing.TypeIs` (added in mypy 1.10, [PEP 742](https://peps.python.org/pep-0742/)) + * Type parameter defaults when using the legacy syntax ([PEP 696](https://peps.python.org/pep-0696/)) These features are not supported yet: * `warnings.deprecated` ([PEP 702](https://peps.python.org/pep-0702/)) @@ -75,8 +97,11 @@ Mypy now always tries to infer a union type for a conditional expression. This r more precise inferred types and lets mypy detect more issues. Notably, if one of the operands has type `Any`, the type of a conditional expression is -now ` | Any`. Previously the inferred type was just `Any`. Example where this is -relevant: +now ` | Any`. Previously the inferred type was just `Any`. The new type essentially +indicates that the value can be of type ``, and potentially of some (unknown) type. +Most operations performed on the result must also be valid for ``. + +Example where this is relevant: ```python from typing import Any @@ -89,14 +114,32 @@ def func(a: Any, b: bool) -> None: This feature was contributed by Ivan Levkivskyi (PR [17427](https://github.com/python/mypy/pull/17427)). -### ReadOnly Support for TypedDict +### ReadOnly Support for TypedDict (PEP 705) - * Add `ReadOnly` support for TypedDicts (sobolevn, PR [17644](https://github.com/python/mypy/pull/17644)) +You can now use `typing.ReadOnly` to specity TypedDict items as +read-only ([PEP 705](https://peps.python.org/pep-0705/)): + +```python +from typing import TypedDict + +# Or "from typing ..." on Python 3.13 +from typing_extensions import ReadOnly + +class TD(TypedDict): + a: int + b: ReadOnly[int] + +d: TD = {"a": 1, "b": 2} +d["a"] = 3 # OK +d["b"] = 5 # Error: "b" is ReadOnly +``` + +This feature was contributed by Nikita Sobolev (PR [17644](https://github.com/python/mypy/pull/17644)). ### Python 3.8 End of Life Approaching We are planning to drop support for Python 3.8 in the next mypy feature release or the -one after that. Python 3.8 reaches end of life in Octoboer 2024. +one after that. Python 3.8 reaches end of life in October 2024. ### Planned Changes to Defaults @@ -121,6 +164,16 @@ For more information, refer to the Mypy documentation now uses modern syntax variants and imports in many examples. Some examples no longer work on Python 3.8, which is the earliest Python version that mypy supports. +Notably, `Iterable` and other protocols/ABCs are imported from `collections.abc`: +```python +from collections.abc import Iterable, Callable +``` + +Examples also avoid the upper-case aliases to built-in types: `list[str]` is used instead +of `List[str]`. The `X | Y` union type syntax introduced in Python 3.10 is also now prevalent. + +List of documentation updates: + * Document `--output=json` CLI option (Edgar Ramírez Mondragón, PR [17611](https://github.com/python/mypy/pull/17611)) * Update various references to deprecated type aliases in docs (Jukka Lehtosalo, PR [17829](https://github.com/python/mypy/pull/17829)) * Make "X | Y" union syntax more prominent in documentation (Jukka Lehtosalo, PR [17835](https://github.com/python/mypy/pull/17835)) @@ -129,6 +182,21 @@ examples no longer work on Python 3.8, which is the earliest Python version that * List all incomplete features in `--enable-incomplete-feature` docs (sobolevn, PR [17633](https://github.com/python/mypy/pull/17633)) * Remove the explicit setting of a pygments theme (Pradyun Gedam, PR [17571](https://github.com/python/mypy/pull/17571)) +### Experimental Inline TypedDict Syntax + +Mypy now supports a non-standard, experimental syntax for defining anonymous TypedDicts. +Example: + +```python +def func(n: str, y: int) -> {"name": str, "year": int}: + return {"name": n, "year": y} +``` + +The feature is disabled by default. Use `--enable-incomplete-feature=InlineTypedDict` to +enable it. *We might remove this feature in a future release.* + +This feature was contributed by Ivan Levkivskyi (PR [17457](https://github.com/python/mypy/pull/17457)). + ### Stubgen Improvements * Fix crash on literal class-level keywords (sobolevn, PR [17663](https://github.com/python/mypy/pull/17663)) @@ -169,7 +237,6 @@ examples no longer work on Python 3.8, which is the earliest Python version that * Fix crash on a callable attribute with single unpack (Ivan Levkivskyi, PR [17641](https://github.com/python/mypy/pull/17641)) * Fix mismatched signature between checker plugin API and implementation (bzoracler, PR [17343](https://github.com/python/mypy/pull/17343)) * Indexing a type also produces a GenericAlias (Shantanu, PR [17546](https://github.com/python/mypy/pull/17546)) - * Experimental: allow inline/anonymous TypedDicts (Ivan Levkivskyi, PR [17457](https://github.com/python/mypy/pull/17457)) * Fix crash on self-type in callable protocol (Ivan Levkivskyi, PR [17499](https://github.com/python/mypy/pull/17499)) * Fix crash on NamedTuple with method and error in function (Ivan Levkivskyi, PR [17498](https://github.com/python/mypy/pull/17498)) * Add `__replace__` for dataclasses in 3.13 (Max Muoto, PR [17469](https://github.com/python/mypy/pull/17469)) From f26749d1fbf3fd63352faea48687a67222077975 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 7 Oct 2024 15:02:29 +0100 Subject: [PATCH 4/8] Small clarification --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b43cad6a055..c82c52bac038 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -164,7 +164,8 @@ For more information, refer to the Mypy documentation now uses modern syntax variants and imports in many examples. Some examples no longer work on Python 3.8, which is the earliest Python version that mypy supports. -Notably, `Iterable` and other protocols/ABCs are imported from `collections.abc`: +Notably, `Iterable` and other protocols/ABCs are imported from `collections.abc` instead of +`typing`: ```python from collections.abc import Iterable, Callable ``` From 9be806ca70457054c5121e309f98165cf344f2fd Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 7 Oct 2024 15:18:06 +0100 Subject: [PATCH 5/8] Add another example --- CHANGELOG.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c82c52bac038..07a628bbd0b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,14 +93,19 @@ List of changes: ### Inferring Unions for Conditional Expressions -Mypy now always tries to infer a union type for a conditional expression. This results in -more precise inferred types and lets mypy detect more issues. +Mypy now always tries to infer a union type for a conditional expression if left and right +operand types are different. This results in more precise inferred types and lets mypy detect +more issues. Example: + +```python +s = "foo" if cond() else 1 +# Type of "s" is now "str | int" (it used to be "object") +``` Notably, if one of the operands has type `Any`, the type of a conditional expression is now ` | Any`. Previously the inferred type was just `Any`. The new type essentially indicates that the value can be of type ``, and potentially of some (unknown) type. Most operations performed on the result must also be valid for ``. - Example where this is relevant: ```python From 7a70d87fb3c93e3a468541ae60fdd23ac2226dfe Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 7 Oct 2024 16:51:33 +0100 Subject: [PATCH 6/8] Update CHANGELOG.md Co-authored-by: Jelle Zijlstra --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07a628bbd0b8..05eb834e5c09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -209,7 +209,7 @@ This feature was contributed by Ivan Levkivskyi (PR [17457](https://github.com/p * Stubgen add `--version` (sobolevn, PR [17662](https://github.com/python/mypy/pull/17662)) * Fix `stubgen --no-analysis/--parse-only` docs (sobolevn, PR [17632](https://github.com/python/mypy/pull/17632)) * Include keyword only args when generating signatures in stubgenc (Eric Mark Martin, PR [17448](https://github.com/python/mypy/pull/17448)) - * Add Literal support for docstrings (Michael Carlstrom, PR [17441](https://github.com/python/mypy/pull/17441)) + * Add support for detecting `Literal` types when extracting types from docstrings (Michael Carlstrom, PR [17441](https://github.com/python/mypy/pull/17441)) * Use `Generator` type var defaults (Sebastian Rittau, PR [17670](https://github.com/python/mypy/pull/17670)) ### Stubtest Improvements From 588b81cf12dad8cf30be7bb566576018a01b5006 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Tue, 8 Oct 2024 10:04:29 +0100 Subject: [PATCH 7/8] Add contributor list --- CHANGELOG.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05eb834e5c09..059df6fc220f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -258,7 +258,33 @@ Please see [git log](https://github.com/python/typeshed/commits/main?after=91a58 ### Acknowledgements Thanks to all mypy contributors who contributed to this release: -- TODO +- Ali Hamdan +- Anders Kaseorg +- Bénédikt Tran +- Brian Schubert +- bzoracler +- Danny Yang +- Edgar Ramírez Mondragón +- Eric Mark Martin +- InSync +- Ivan Levkivskyi +- Jordandev678 +- Katrina Connors +- Kirill Podoprigora +- Marc Mueller +- Max Muoto +- Max Murin +- Michael Carlstrom +- Michael I Chen +- Pradyun Gedam +- quinn-sasha +- Raphael Krupinski +- Sebastian Rittau +- Shantanu +- sobolevn +- Soubhik Kumar Mitra +- Stanislav Terliakov +- wyattscarpenter I’d also like to thank my employer, Dropbox, for supporting mypy development. From ee6aa0204fcab9437b074dcab27ef81bce178ecb Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Tue, 8 Oct 2024 10:10:04 +0100 Subject: [PATCH 8/8] Minor updates --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 059df6fc220f..c664121f097d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -226,7 +226,7 @@ This feature was contributed by Ivan Levkivskyi (PR [17457](https://github.com/p * Fix narrowing of IntEnum and StrEnum types (Jukka Lehtosalo, PR [17874](https://github.com/python/mypy/pull/17874)) * Filter overload items based on self type during type inference (Jukka Lehtosalo, PR [17873](https://github.com/python/mypy/pull/17873)) * Enable negative narrowing of union TypeVar upper bounds (Brian Schubert, PR [17850](https://github.com/python/mypy/pull/17850)) - * Fix get_member_expr_fullname returning strings with embedded "None" (Brian Schubert, PR [17848](https://github.com/python/mypy/pull/17848)) + * Fix issue with member expression formatting (Brian Schubert, PR [17848](https://github.com/python/mypy/pull/17848)) * Avoid type size explosion when expanding types (Jukka Lehtosalo, PR [17842](https://github.com/python/mypy/pull/17842)) * Fix negative narrowing of tuples in match statement (Brian Schubert, PR [17817](https://github.com/python/mypy/pull/17817)) * Narrow falsey str/bytes/int to literal type (Brian Schubert, PR [17818](https://github.com/python/mypy/pull/17818)) @@ -237,7 +237,7 @@ This feature was contributed by Ivan Levkivskyi (PR [17457](https://github.com/p * Added error code for overlapping function signatures (Katrina Connors, PR [17597](https://github.com/python/mypy/pull/17597)) * Check for `truthy-bool` in `not ...` unary expressions (sobolevn, PR [17773](https://github.com/python/mypy/pull/17773)) * Add missing lines-covered and lines-valid attributes (Soubhik Kumar Mitra, PR [17738](https://github.com/python/mypy/pull/17738)) - * Fix another crash scenario on recursive tuple types (Ivan Levkivskyi, PR [17708](https://github.com/python/mypy/pull/17708)) + * Fix another crash scenario with recursive tuple types (Ivan Levkivskyi, PR [17708](https://github.com/python/mypy/pull/17708)) * Resolve TypeVar upper bounds in `functools.partial` (Shantanu, PR [17660](https://github.com/python/mypy/pull/17660)) * Always reset binder when checking deferred nodes (Ivan Levkivskyi, PR [17643](https://github.com/python/mypy/pull/17643)) * Fix crash on a callable attribute with single unpack (Ivan Levkivskyi, PR [17641](https://github.com/python/mypy/pull/17641))