Skip to content

Scheduled monthly dependency update for January#169

Open
pyup-bot wants to merge 35 commits intodevelopfrom
pyup-scheduled-update-2026-01-01
Open

Scheduled monthly dependency update for January#169
pyup-bot wants to merge 35 commits intodevelopfrom
pyup-scheduled-update-2026-01-01

Conversation

@pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Jan 1, 2026

Update cffi from 1.17.1 to 2.0.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update cryptography from 45.0.5 to 46.0.3.

Changelog

46.0.3

~~~~~~~~~~~~~~~~~~~

* Fixed compilation when using LibreSSL 4.2.0.

.. _v46-0-2:

46.0.2

~~~~~~~~~~~~~~~~~~~

* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.5.4.

.. _v46-0-1:

46.0.1

~~~~~~~~~~~~~~~~~~~

* Fixed an issue where users installing via ``pip`` on Python 3.14 development
versions would not properly install a dependency.
* Fixed an issue building the free-threaded macOS 3.14 wheels.

.. _v46-0-0:

46.0.0

~~~~~~~~~~~~~~~~~~~

* **BACKWARDS INCOMPATIBLE:** Support for Python 3.7 has been removed.
* Support for OpenSSL < 3.0 is deprecated and will be removed in the next
release.
* Support for ``x86_64`` macOS (including publishing wheels) is deprecated
and will be removed in two releases. We will switch to publishing an
``arm64`` only wheel for macOS.
* Support for 32-bit Windows (including publishing wheels) is deprecated
and will be removed in two releases. Users should move to a 64-bit
Python installation.
* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.5.3.
* We now build ``ppc64le`` ``manylinux`` wheels and publish them to PyPI.
* We now build ``win_arm64`` (Windows on Arm) wheels and publish them to PyPI.
* Added support for free-threaded Python 3.14.
* Removed the deprecated ``get_attribute_for_oid`` method on
:class:`~cryptography.x509.CertificateSigningRequest`. Users should use
:meth:`~cryptography.x509.Attributes.get_attribute_for_oid` instead.
* Removed the deprecated ``CAST5``, ``SEED``, ``IDEA``, and ``Blowfish``
classes from the cipher module. These are still available in
:doc:`/hazmat/decrepit/index`.
* In X.509, when performing a PSS signature with a SHA-3 hash, it is now
encoded with the official NIST SHA3 OID.

.. _v45-0-7:

45.0.7

~~~~~~~~~~~~~~~~~~~

* Added a function to support an upcoming ``pyOpenSSL`` release.

.. _v45-0-6:

45.0.6

~~~~~~~~~~~~~~~~~~~

* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.5.2.

.. _v45-0-5:
Links

Update googleapis-common-protos from 1.70.0 to 1.72.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update grpcio from 1.73.1 to 1.76.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update protobuf from 6.31.1 to 6.33.2.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update pycparser from 2.22 to 2.23.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update attrs from 25.3.0 to 25.4.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update bleach from 6.2.0 to 6.3.0.

Changelog

6.3.0

----------------------------------

**Backwards incompatible changes**

* Dropped support for Python 3.9. (756)

**Security fixes**

None

**Bug fixes**

* Add support for Python 3.14. (758)
* Fix wbr handling. (488)
Links

Update certifi from 2025.6.15 to 2025.11.12.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update coverage from 7.9.2 to 7.13.1.

Changelog

7.13.1

---------------------------

- Added: the JSON report now includes a ``"start_line"`` key for function and
class regions, indicating the first line of the region in the source. Closes
`issue 2110`_.

- Added: The ``debug data`` command now takes file names as arguments on the
command line, so you can inspect specific data files without needing to set
the ``COVERAGE_FILE`` environment variable.

- Fix: the JSON report used to report module docstrings as executed lines,
which no other report did, as described in `issue 2105`_. This is now fixed,
thanks to Jianrong Zhao.

- Fix: coverage.py uses a more disciplined approach to detecting where
third-party code is installed, and avoids measuring it. This shouldn't change
any behavior. If you find that it does, please get in touch.

- Performance: data files that will be combined now record their hash as part
of the file name. This lets us skip duplicate data more quickly, speeding the
combining step.

- Docs: added a section explaining more about what is considered a missing
branch and how it is reported: :ref:`branch_explain`, as requested in `issue
1597`_. Thanks to `Ayisha Mohammed <pull 2092_>`_.

- Tests: the test suite misunderstood what core was being tested if
``COVERAGE_CORE`` wasn't set on 3.14+. This is now fixed, closing `issue
2109`_.

.. _issue 1597: https://github.com/coveragepy/coveragepy/issues/1597
.. _pull 2092: https://github.com/coveragepy/coveragepy/pull/2092
.. _issue 2105: https://github.com/coveragepy/coveragepy/issues/2105
.. _issue 2109: https://github.com/coveragepy/coveragepy/issues/2109
.. _issue 2110: https://github.com/coveragepy/coveragepy/issues/2110

.. _changes_7-13-0:

7.13.0

---------------------------

- Feature: coverage.py now supports :file:`.coveragerc.toml` configuration
files. These files use TOML syntax and take priority over
:file:`pyproject.toml` but lower priority than :file:`.coveragerc` files.
Closes `issue 1643`_ thanks to `Olena Yefymenko <pull 1952_>`_.

- Fix: we now include a permanent .pth file which is installed with the code,
fixing `issue 2084`_.  In 7.12.1b1 this was done incorrectly: it didn't work
when using the source wheel (``py3-none-any``).  This is now fixed. Thanks,
`Henry Schreiner <pull 2100_>`_.

- Deprecated: when coverage.py is installed, it creates three command entry
points: ``coverage``, ``coverage3``, and ``coverage-3.10`` (if installed for
Python 3.10). The second and third of these are not needed and will
eventually be removed. They still work for now, but print a message about
their deprecation.

.. _issue 1643: https://github.com/coveragepy/coveragepy/issues/1643
.. _pull 1952: https://github.com/coveragepy/coveragepy/pull/1952
.. _pull 2100: https://github.com/coveragepy/coveragepy/pull/2100


.. _changes_7-12-1b1:

7.12.1b1

-----------------------------

- Fix: coverage.py now includes a permanent .pth file in the distribution which
is installed with the code. This fixes `issue 2084`_: failure to patch for
subprocess measurement when site-packages is not writable.

.. _issue 2084: https://github.com/coveragepy/coveragepy/issues/2084


.. _changes_7-12-0:

7.12.0

---------------------------

- The HTML report now shows separate coverage totals for statements and
branches, as well as the usual combined coverage percentage. Thanks to Ryuta
Otsuka for the `discussion <issue 2081_>`_ and the `implementation
<pull 2085_>`_.

- The JSON report now includes separate coverage totals for statements and
branches, thanks to `Ryuta Otsuka <pull 2090_>`_.

- Fix: ``except*`` clauses were not handled properly under the "sysmon"
measurement core, causing KeyError exceptions as described in `issue 2086`_.
This is now fixed.

- Fix: we now defend against aggressive mocking of ``open()`` that could cause
errors inside coverage.py.  An example of a failure is in `issue 2083`_.

- Fix: in unusual cases where a test suite intentionally exhausts the system's
file descriptors to test handling errors in ``open()``, coverage.py would
fail when trying to open source files, as described in `issue 2091`_.  This
is now fixed.

- A small tweak to the HTML report: file paths now use thin spaces around
slashes to make them easier to read.

.. _issue 2081: https://github.com/coveragepy/coveragepy/issues/2081
.. _issue 2083: https://github.com/coveragepy/coveragepy/issues/2083
.. _pull 2085: https://github.com/coveragepy/coveragepy/pull/2085
.. _issue 2086: https://github.com/coveragepy/coveragepy/issues/2086
.. _pull 2090: https://github.com/coveragepy/coveragepy/pull/2090
.. _issue 2091: https://github.com/coveragepy/coveragepy/issues/2091


.. _changes_7-11-3:

7.11.3

---------------------------

- Fix: the 7.11.1 changes meant that conflicts between a requested measurement
core and other settings would raise an error. This was a breaking change from
previous behavior, as reported in `issue 2076`_ and `issue 2078`_.

The previous behavior has been restored: when the requested core conflicts
with other settings, another core is used instead, and a warning is issued.

- For contributors: the repo has moved from Ned's `nedbat GitHub account`_ to
the `coveragepy GitHub organization`_. The default branch has changed from
master to main.

.. _issue 2076: https://github.com/coveragepy/coveragepy/issues/2076
.. _issue 2078: https://github.com/coveragepy/coveragepy/issues/2078
.. _nedbat GitHub account: https://github.com/nedbat
.. _coveragepy GitHub organization: https://github.com/coveragepy


.. _changes_7-11-2:

7.11.2

---------------------------

- Fix: using the "sysmon" measurement core in 7.11.1, if Python code was
claimed to come from a non-Python file, a ``NotPython`` exception could be
raised. This could happen for example with Jinja templates compiled to
Python, as reported in `issue 2077`_. This is now fixed.

- Doc: corrected the first entry in the 7.11.1 changelog.

.. _issue 2077: https://github.com/coveragepy/coveragepy/issues/2077


.. _changes_7-11-1:

7.11.1

---------------------------

- Fix: some chanages to details of how the measurement core is chosen, and how
conflicting settings are handled. The "sysmon" core cannot be used with some
conurrency settings, with dynamic context, and in Python 3.12/3.13, with
branch measurement.

- If the core is not specified and defaults to "sysmon" (Python 3.14+), but
 other settings conflict with sysmon, then the "ctrace" core will be used
 instead with no warning. For concurrency conflicts, this used to produce an
 error, as described in `issue 2064`_.

- If the "sysmon" core is explicitly requested in your configuration, but
 other settings conflict, an error is now raised. This used to produce a
 warning.

- Fix: some multi-line case clauses or for loops (and probably other
constructs) could cause incorrect claims of missing branches with the
sys.monitoring core, as described in `issue 2070`_. This is now fixed.

- Fix: when running in pytest under coverage, a ``breakpoint()`` would stop in
the wrong frame, one level down from where it should, as described in `issue
1420`_. This was due to a coverage change in v6.4.1 that seemed to give a
slight performance improvement, but I couldn't reproduce the performance
gain, so it's been reverted, fixing the debugger problem.

- A new debug option ``--debug=core`` shows which core is in use and why.

- Split ``sqlite`` debugging information out of the ``sys`` :ref:`coverage
debug <cmd_debug>` and :ref:`cmd_run_debug` options since it's bulky and not
very useful.

- Updated the :ref:`howitworks` page to better describe the three different
measurement cores.

.. _issue 1420: https://github.com/coveragepy/coveragepy/issues/1420
.. _issue 2064: https://github.com/coveragepy/coveragepy/issues/2064
.. _issue 2070: https://github.com/coveragepy/coveragepy/issues/2070


.. _changes_7-11-0:

7.11.0

---------------------------

- Dropped support for Python 3.9, declared support for Python 3.15 alpha.


.. _changes_7-10-7:

7.10.7

---------------------------

- Performance: with branch coverage in large files, generating HTML, JSON, or
LCOV reports could take far too long due to some quadratic behavior when
creating the function and class index pages.  This is now fixed, closing
`issue 2048`_.  Thanks to Daniel Diniz for help diagnosing the problem.

- Most warnings and a few errors now have links to a page in the docs
explaining the specific message.  Closes `issue 1921`_.

.. _issue 1921: https://github.com/coveragepy/coveragepy/issues/1921
.. _issue 2048: https://github.com/coveragepy/coveragepy/issues/2048


.. _changes_7-10-6:

7.10.6

---------------------------

- Fix: ``source`` directories were not properly communicated to subprocesses
that ran in different directories, as reported in `issue 1499`_.  This is now
fixed.

- Performance: `Alex Gaynor continues fine-tuning <pull 2038_>`_ the speed of
combination, especially with many contexts.

.. _issue 1499: https://github.com/coveragepy/coveragepy/issues/1499
.. _pull 2038: https://github.com/coveragepy/coveragepy/pull/2038


.. _changes_7-10-5:

7.10.5

---------------------------

- Big speed improvements for ``coverage combine``: it's now about twice as
fast! Huge thanks to Alex Gaynor for pull requests `2032 <pull 2032_>`_,
`2033 <pull 2033_>`_, and `2034 <pull 2034_>`_.

.. _pull 2032: https://github.com/coveragepy/coveragepy/pull/2032
.. _pull 2033: https://github.com/coveragepy/coveragepy/pull/2033
.. _pull 2034: https://github.com/coveragepy/coveragepy/pull/2034


.. _changes_7-10-4:

7.10.4

---------------------------

- Added ``patch = fork`` for times when the built-in forking support is
insufficient.

- Fix: ``patch = execv`` also inherits the entire coverage configuration now.


.. _changes_7-10-3:

7.10.3

---------------------------

- Fixes for ``patch = subprocess``:

- If subprocesses spawned yet more subprocesses simultaneously, some coverage
 could be missed.  This is now fixed, closing `issue 2024`_.

- If subprocesses were created in other directories, their data files were
 stranded there and not combined into the totals, as described in `issue
 2025`_.  This is now fixed.

- On Windows (or maybe only some Windows?) the patch would fail with a
 ``ModuleNotFound`` error trying to import coverage.  This is now fixed,
 closing `issue 2022`_.

- Originally only options set in the coverage configuration file would apply
 to subprocesses.  Options set on the ``coverage run`` command line (such as
 ``--branch``) wouldn't be communicated to the subprocesses.  This could
 lead to combining failures, as described in `issue 2021`_. Now the entire
 configuration is used in subprocesses, regardless of its origin.

- Added ``debug=patch`` to help diagnose problems.

- Fix: really close all SQLite databases, even in-memory ones. Closes `issue
2017`_.

.. _issue 2017: https://github.com/coveragepy/coveragepy/issues/2017
.. _issue 2021: https://github.com/coveragepy/coveragepy/issues/2021
.. _issue 2022: https://github.com/coveragepy/coveragepy/issues/2022
.. _issue 2024: https://github.com/coveragepy/coveragepy/issues/2024
.. _issue 2025: https://github.com/coveragepy/coveragepy/issues/2025


.. _changes_7-10-2:

7.10.2

---------------------------

- Fix: some code with NOP bytecodes could report missing branches that are
actually executed. This is now fixed, closing `issue 1999`_. Python 3.9
still shows the problem.

.. _issue 1999: https://github.com/coveragepy/coveragepy/issues/1999


.. _changes_7-10-1:

7.10.1

---------------------------

- Fix: the exclusion for ``if TYPE_CHECKING:`` was wrong: it marked the branch
as partial, but it should have been a line exclusion so the entire clause
would be excluded. Improves `issue 831`_.

- Fix: changed where .pth files are written for ``patch = subprocess``, closing
`issue 2006`_.

.. _issue 2006: https://github.com/coveragepy/coveragepy/issues/2006


.. _changes_7-10-0:

7.10.0

---------------------------

- A new configuration option: ":ref:`config_run_patch`" specifies named patches
to work around some limitations in coverage measurement.  These patches are
available:

- ``patch = _exit`` lets coverage save its data even when :func:`os._exit()
 <python:os._exit>` is used to abruptly end the process.  This closes
 long-standing `issue 310`_ as well as its duplicates: `issue 312`_, `issue
 1673`_, `issue 1845`_, and `issue 1941`_.

- ``patch = subprocess`` measures coverage in Python subprocesses created
 with :mod:`subprocess`, :func:`os.system`, or one of the :func:`execv
 <python:os.execl>` or :func:`spawnv <python:os.spawnl>` family of
 functions. Closes old `issue 367`_, its duplicate `issue 378`_ and old
 `issue 689`_.

- ``patch = execv`` adjusts the :func:`execv <python:os.execl>` family of
 functions to save coverage data before ending the current program and
 starting the next. Not available on Windows. Closes `issue 43`_ after 15
 years!

- The HTML report now dimly colors subsequent lines in multi-line statements.
They used to have no color.  This gives a better indication of the amount of
code missing in the report.  Closes `issue 1308`_.

- Two new exclusion patterns are part of the defaults: ``...`` is automatically
excluded as a line and ``if TYPE_CHECKING:`` is excluded as a branch.  Closes
`issue 831`_.

- A new command-line option: ``--save-signal=USR1`` specifies a signal that
coverage.py will listen for.  When the signal is sent, the coverage data will
be saved.  This makes it possible to save data from within long-running
processes.  Thanks, `Arkady Gilinsky <pull 1998_>`_.

- A new configuration option: ":ref:`config_report_partial_also`" is a list of
regexes to add as pragmas for partial branches.  This parallels the
":ref:`config_report_exclude_also`" setting for adding line exclusion
patterns.

- A few file path configuration settings didn't allow for tilde expansion:
:ref:`config_json_output`, :ref:`config_lcov_output` and
:ref:`config_run_debug_file`.  This is now fixed.

- Wheels are included for 3.14 now that 3.14 rc1 is available.

- We no longer ship a PyPy-specific wheel. PyPy will install the pure-Python
wheel.  Closes `issue 2001`_.

- In the very unusual situation of not having a current frame, coverage no
longer crashes when using the sysmon core, fixing `issue 2005`_.

.. _issue 43: https://github.com/coveragepy/coveragepy/issues/43
.. _issue 310: https://github.com/coveragepy/coveragepy/issues/310
.. _issue 312: https://github.com/coveragepy/coveragepy/issues/312
.. _issue 367: https://github.com/coveragepy/coveragepy/issues/367
.. _issue 378: https://github.com/coveragepy/coveragepy/issues/378
.. _issue 689: https://github.com/coveragepy/coveragepy/issues/689
.. _issue 831: https://github.com/coveragepy/coveragepy/issues/831
.. _issue 1308: https://github.com/coveragepy/coveragepy/issues/1308
.. _issue 1673: https://github.com/coveragepy/coveragepy/issues/1673
.. _issue 1845: https://github.com/coveragepy/coveragepy/issues/1845
.. _issue 1941: https://github.com/coveragepy/coveragepy/issues/1941
.. _pull 1998: https://github.com/coveragepy/coveragepy/pull/1998
.. _issue 2001: https://github.com/coveragepy/coveragepy/issues/2001
.. _issue 2005: https://github.com/coveragepy/coveragepy/issues/2005

.. _changes_7-9-2:
Links

Update distlib from 0.3.9 to 0.4.0.

Changelog

0.4.0

~~~~~

Released: 2025-07-17

- markers

 - Add the ``interpret_parsed`` function.

- wheel

 - Fix 238: Add build tag to wheel metadata if specified.

 - Fix 243: Update to support free-threading version of Python (3.13t).

 - Fix 246: Support subdirectories in the dist-info directory. Thanks to Pieter P for the patch.

 - Fix 248: Fix path normalisation issue caused by the fix for 246.

 - Move import in script wrapper to "if __name__ == 'main'" clause.

- tests

 - Fix 245: Skip test_package_data if a SKIP_EXT_PACKAGE_DATA environment variable is present.
Links

Update docutils from 0.21.2 to 0.22.4.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update filelock from 3.18.0 to 3.20.1.

Changelog

3.20.1

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
* CVE-2025-68146: Fix TOCTOU symlink vulnerability in lock file creation by gaborbernat in https://github.com/tox-dev/filelock/pull/461


**Full Changelog**: https://github.com/tox-dev/filelock/compare/3.20.0...3.20.1

3.20.0

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
* Add tox.toml to sdist by mtelka in https://github.com/tox-dev/filelock/pull/436
* Update docs with example by znichollscr in https://github.com/tox-dev/filelock/pull/438
* Add 3.14 support and drop 3.9 by gaborbernat in https://github.com/tox-dev/filelock/pull/448

New Contributors
* mtelka made their first contribution in https://github.com/tox-dev/filelock/pull/436
* znichollscr made their first contribution in https://github.com/tox-dev/filelock/pull/438

**Full Changelog**: https://github.com/tox-dev/filelock/compare/3.19.1...3.20.0

3.19.1

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
* add 3.14t (free threading) to matrix by paultiq in https://github.com/tox-dev/filelock/pull/433
* Increase test coverage by paultiq in https://github.com/tox-dev/filelock/pull/434

New Contributors
* paultiq made their first contribution in https://github.com/tox-dev/filelock/pull/433

**Full Changelog**: https://github.com/tox-dev/filelock/compare/3.19.0...3.19.1

3.19.0

<!-- Release notes generated using configuration in .github/release.yml at main -->

What's Changed
* Add support for 3.14 by gaborbernat in https://github.com/tox-dev/filelock/pull/432


**Full Changelog**: https://github.com/tox-dev/filelock/compare/3.18.0...3.19.0
Links

Update grpcio-tools from 1.73.1 to 1.76.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update idna from 3.10 to 3.11.

Changelog

3.11

- Update to Unicode 16.0.0, including significant changes to UTS46
processing. As a result of Unicode ending support for it, transitional
processing no longer has an effect and returns the same result.
- Add support for Python 3.14, lowest supported version is Python 3.8.
- Various updates to packaging, including PEP 740 support.
Links

Update importlib-metadata from 8.7.0 to 8.7.1.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update keyring from 25.6.0 to 25.7.0.

Changelog

25.7.0

=======

Features
--------

- Improved support for KWallet 6. (728)


Bugfixes
--------

- Removed cruft from Python 3.8. (722)
Links

Update markupsafe from 3.0.2 to 3.0.3.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update more-itertools from 10.7.0 to 10.8.0.

Changelog

10.8.0

------

* New functions:
 * :func:`derangements` was added (thanks to debruijn)
 * :func:`argmin` and :func:`argmax` were added (thanks to rhettinger)
 * :func:`running_median` was added (thanks to rhettinger)
 * :func:`extract` was added (thanks to rhettinger)
 * :func:`interleave_randomly` was added (thanks to ktbarrett)

* Changes to existing functions:
 * The type hints and docstring for :func:`batched` were improved (thanks to qobilidop and inventshah)
 * The memory usage of :func:`islice_extended` was reduced (thanks to ben42code)
 * The performance of :func:`sample` and :func:`consecutive_groups`, :func:`dft`, :func:`idft`, :func:`map_if`, :func:`count_cycle`, and :func:`tail` were improved (thanks to rhettinger) 
 * The performance of :func:`before_and_after`, :func:`mark_ends`, and :func:`interleave_longest` were improved (thanks to pochmann3) 
 * :func:`nth_prime` now accepts an ``approximate`` keyword. When set to ``True``, a faster but less accurate method is used to return a result. (thanks to rhettinger)
 * :func:`last` now works when its input has ``__reversed__`` set to ``None`` (thanks to inventshah)
 * The :func:`unzip` function was simplified (thanks to pochmann3)
 * The :func:`reshape` function now accepts ``shape`` values that represent multidimensional matrices (thanks to rhettinger)

* Other changes:
 * An issue with dark themes and documentation display was fixed (thanks to pochmann3, moreati, and pradyunsg)
 * Variable names in several functions were improved (thanks to rhettinger)
 * The docstrings for :func:`dft`, :func:`idft`, :func:`minmax`, :func:`sample`, and :func:`multinomial` were improved (thanks to rhettinger)
 * Packaging and package index metadata were improved (thanks to cdce8p)
 * Several aspects of the documentation were improved (thanks to rhettinger, saadmanrafat)
 * The Makefile now refers to `python` instead of `python3` (thanks to ktbarrett)
 * Test coverage was improved (thanks to rhettinger)
 * Python 3.14 is now tested by GitHub Actions
Links

Update mypy from 1.16.1 to 1.19.1.

Changelog

1.19.1

- Fix noncommutative joins with bounded TypeVars (Shantanu, PR [20345](https://github.com/python/mypy/pull/20345))
- Respect output format for cached runs by serializing raw errors in cache metas (Ivan Levkivskyi, PR [20372](https://github.com/python/mypy/pull/20372))
- Allow `types.NoneType` in match cases (A5rocks, PR [20383](https://github.com/python/mypy/pull/20383))
- Fix mypyc generator regression with empty tuple (BobTheBuidler, PR [20371](https://github.com/python/mypy/pull/20371))
- Fix crash involving Unpack-ed TypeVarTuple (Shantanu, PR [20323](https://github.com/python/mypy/pull/20323))
- Fix crash on star import of redefinition (Ivan Levkivskyi, PR [20333](https://github.com/python/mypy/pull/20333))
- Fix crash on typevar with forward ref used in other module (Ivan Levkivskyi, PR [20334](https://github.com/python/mypy/pull/20334))
- Fail with an explicit error on PyPy (Ivan Levkivskyi, PR [20389](https://github.com/python/mypy/pull/20389))

Acknowledgements

Thanks to all mypy contributors who contributed to this release:
- A5rocks
- BobTheBuidler
- bzoracler
- Chainfire
- Christoph Tyralla
- David Foster
- Frank Dana
- Guo Ci
- iap
- Ivan Levkivskyi
- James Hilton-Balfe
- jhance
- Joren Hammudoglu
- Jukka Lehtosalo
- KarelKenens
- Kevin Kannammalil
- Marc Mueller
- Michael Carlstrom
- Michael J. Sullivan
- Piotr Sawicki
- Randolf Scholz
- Shantanu
- Sigve Sebastian Farstad
- sobolevn
- Stanislav Terliakov
- Stephen Morton
- Theodore Ando
- Thiago J. Barbalho
- wyattscarpenter

I’d also like to thank my employer, Dropbox, for supporting mypy development.

1.19

We’ve just uploaded mypy 1.19.0 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).

Python 3.9 Support Ending Soon

This is the last mypy feature release that supports Python 3.9, which reached
end of life in October 2025.

Performance Improvements
- Switch to a more dynamic SCC processing logic (Ivan Levkivskyi, PR [20053](https://github.com/python/mypy/pull/20053))
- Speed up type aliases (Ivan Levkivskyi, PR [19810](https://github.com/python/mypy/pull/19810))

Fixed‑Format Cache Improvements

Mypy uses a cache by default to speed up incremental runs by reusing partial results
from earlier runs. Mypy 1.18 added a new binary fixed-format cache representation as
an experimental feature. The feature is no longer experimental, and we are planning
to enable it by default in a future mypy release (possibly 1.20), since it's faster
and uses less space than the original, JSON-based cache format. Use
`--fixed-format-cache` to enable the fixed-format cache.

Mypy now has an extra dependency on the `librt` PyPI package, as it's needed for
cache serialization and deserialization.

Mypy ships with a tool to convert fixed-format cache files to the old JSON format.
Example of how to use this:

$ python -m mypy.exportjson .mypy_cache/.../my_module.data.ff


This way existing use cases that parse JSON cache files can be supported when using
the new format, though an extra conversion step is needed.

This release includes these improvements:

- Force-discard cache if cache format changed (Ivan Levkivskyi, PR [20152](https://github.com/python/mypy/pull/20152))
- Add tool to convert binary cache files to JSON (Jukka Lehtosalo, PR [20071](https://github.com/python/mypy/pull/20071))
- Use more efficient serialization format for long integers in cache files (Jukka Lehtosalo, PR [20151](https://github.com/python/mypy/pull/20151))
- More robust packing of floats in fixed-format cache (Ivan Levkivskyi, PR [20150](https://github.com/python/mypy/pull/20150))
- Use self-descriptive cache with type tags (Ivan Levkivskyi, PR [20137](https://github.com/python/mypy/pull/20137))
- Use fixed format for cache metas (Ivan Levkivskyi, PR [20088](https://github.com/python/mypy/pull/20088))
- Make metas more compact; fix indirect suppression (Ivan Levkivskyi, PR [20075](https://github.com/python/mypy/pull/20075))
- Use dedicated tags for most common cached instances (Ivan Levkivskyi, PR [19762](https://github.com/python/mypy/pull/19762))

PEP 747: Annotating Type Forms

Mypy now recognizes `TypeForm[T]` as a type and implements
[PEP 747](https://peps.python.org/pep-0747/). The feature is still experimental,
and it's disabled by default. Use `--enable-incomplete-feature=TypeForm` to
enable type forms. A type form object captures the type information provided by a
runtime type expression. Example:

python
from typing_extensions import TypeForm

def trycast[T](typx: TypeForm[T], value: object) -> T | None: ...

def example(o: object) -> None:
  'int | str' below is an expression that represents a type.
  Unlike type[T], TypeForm[T] can be used with all kinds of types,
  including union types.
 x = trycast(int | str, o)
 if x is not None:
      Type of 'x' is 'int | str' here
     ...


This feature was contributed by David Foster (PR [19596](https://github.com/python/mypy/pull/19596)).

Fixes to Crashes
- Do not push partial types to the binder (Stanislav Terliakov, PR [20202](https://github.com/python/mypy/pull/20202))
- Fix crash on recursive tuple with Hashable (Ivan Levkivskyi, PR [20232](https://github.com/python/mypy/pull/20232))
- Fix crash related to decorated functions (Stanislav Terliakov, PR [20203](https://github.com/python/mypy/pull/20203))
- Do not abort constructing TypeAlias if only type parameters hold us back (Stanislav Terliakov, PR [20162](https://github.com/python/mypy/pull/20162))
- Use the fallback for `ModuleSpec` early if it can never be resolved (Stanislav Terliakov, PR [20167](https://github.com/python/mypy/pull/20167))
- Do not store deferred NamedTuple fields as redefinitions (Stanislav Terliakov, PR [20147](https://github.com/python/mypy/pull/20147))
- Discard partial types remaining after inference failure (Stanislav Terliakov, PR [20126](https://github.com/python/mypy/pull/20126))
- Fix an infinite recursion bug (Stanislav Terliakov, PR [20127](https://github.com/python/mypy/pull/20127))
- Fix IsADirectoryError for namespace packages when using --linecoverage-report (wyattscarpenter, PR [20109](https://github.com/python/mypy/pull/20109))
- Fix an internal error when creating cobertura output for namespace package (wyattscarpenter, PR [20112](https://github.com/python/mypy/pull/20112))
- Allow type parameters reusing the name missing from current module (Stanislav Terliakov, PR [20081](https://github.com/python/mypy/pull/20081))
- Prevent TypeGuardedType leak from narrowing declared type as part of type variable bound (Stanislav Terliakov, PR [20046](https://github.com/python/mypy/pull/20046))
- Fix crash on invalid unpack in base class (Ivan Levkivskyi, PR [19962](https://github.com/python/mypy/pull/19962))
- Traverse ParamSpec prefix where we should (Ivan Levkivskyi, PR [19800](https://github.com/python/mypy/pull/19800))
- Fix daemon crash related to imports (Ivan Levkivskyi, PR [20271](https://github.com/python/mypy/pull/20271))

Mypyc: Support for `__getattr__`, `__setattr__`, and `__delattr__`

Mypyc now has partial support for `__getattr__`, `__setattr__` and
`__delattr__` methods in native classes.

Note that native attributes are not stored using `__dict__`. Setting attributes
directly while bypassing `__setattr__` is possible by using
`super().__setattr__(...)` or `object.__setattr__(...)`, but not via `__dict__`.

Example:
python
class Demo:
 _data: dict[str, str]

 def __init__(self) -> None:
      Initialize data dict without calling our __setattr__
     super().__setattr__("_data", {})

 def __setattr__(self, name: str, value: str) -> None:
     print(f"Setting {name} = {value!r}")

     if name == "_data":
         raise AttributeError("'_data' cannot be set")

     self._data[name] = value

 def __getattr__(self, name: str) -> str:
     print(f"Getting {name}")

     try:
         return self._data[name]
     except KeyError:
         raise AttributeError(name)

d = Demo()
d.x = "hello"
d.y = "world"

print(d.x)
print(d.y)


Related PRs:
- Generate `__setattr__` wrapper (Piotr Sawicki, PR [19937](https://github.com/python/mypy/pull/19937))
- Generate `__getattr__` wrapper (Piotr Sawicki, PR [19909](https://github.com/python/mypy/pull/19909))
- Support deleting attributes in `__setattr__` wrapper (Piotr Sawicki, PR [19997](https://github.com/python/mypy/pull/19997))

Miscellaneous Mypyc Improvements
- Fix `__new__` in native classes with inheritance (Piotr Sawicki, PR [20302](https://github.com/python/mypy/pull/20302))
- Fix crash on `super` in generator (Ivan Levkivskyi, PR [20291](https://github.com/python/mypy/pull/20291))
- Fix calling base class async method using `super()` (Jukka Lehtosalo, PR [20254](https://github.com/python/mypy/pull/20254))
- Fix async or generator methods in traits (Jukka Lehtosalo, PR [20246](https://github.com/python/mypy/pull/20246))
- Optimize equality check with string literals (BobTheBuidler, PR [19883](https://github.com/python/mypy/pull/19883))
- Fix inheritance of async defs (Jukka Lehtosalo, PR [20044](https://github.com/python/mypy/pull/20044))
- Reject invalid `mypyc_attr` args (BobTheBuidler, PR [19963](https://github.com/python/mypy/pull/19963))
- Optimize `isinstance` with tuple of primitive types (BobTheBuidler, PR [19949](https://github.com/python/mypy/pull/19949))
- Optimize away first index check in for loops if length > 1 (BobTheBuidler, PR [19933](https://github.com/python/mypy/pull/19933))
- Fix broken exception/cancellation handling in async def (Jukka Lehtosalo, PR [19951](https://github.com/python/mypy/pull/19951))
- Transform `object.__new__` inside `__new__` (Piotr Sawicki, PR [19866](https://github.com/python/mypy/pull/19866))
- Fix crash with NewType and other non-class types in incremental builds (Jukka Lehtosalo, PR [19837](https://github.com/python/mypy/pull/19837))
- Optimize container creation from expressions with length known at compile time (BobTheBuidler, PR [19503](https://github.com/python/mypy/pull/19503))
- Allow per-class free list to be used with inheritance (Jukka Lehtosalo, PR [19790](https://github.com/python/mypy/pull/19790))
- Fix object finalization (Marc Mueller, PR [19749](https://github.com/python/mypy/pull/19749))
- Allow defining a single-item free "list" for a native class (Jukka Lehtosalo, PR [19785](https://github.com/python/mypy/pull/19785))
- Speed up unary "not" (Jukka Lehtosalo, PR [19774](https://github.com/python/mypy/pull/19774))

Stubtest Improvements
- Check `_value_` for ellipsis-valued stub enum members (Stanislav Terliakov, PR [19760](https://github.com/python/mypy/pull/19760))
- Include function name in overload assertion messages (Joren Hammudoglu, PR [20063](https://github.com/python/mypy/pull/20063))
- Fix special case in analyzing function signature (iap, PR [19822](https://github.com/python/mypy/pull/19822))
- Improve `allowlist` docs with better example (sobolevn, PR [20007](https://github.com/python/mypy/pull/20007))

Documentation Updates
- Update duck type compatibility: mention strict-bytes and mypy 2.0 (wyattscarpenter, PR [20121](https://github.com/python/mypy/pull/20121))
- Document `--enable-incomplete-feature TypeForm` (wyattscarpenter, PR [20173](https://github.com/python/mypy/pull/20173))
- Change the inline TypedDict example (wyattscarpenter, PR [20172](https://github.com/python/mypy/pull/20172))
- Replace `List` with built‑in `list` (PEP 585) (Thiago J. Barbalho, PR [20000](https://github.com/python/mypy/pull/20000))
- Improve junit documentation (wyattscarpenter, PR [19867](https://github.com/python/mypy/pull/19867))

Other Notable Fixes and Improvements
- Fix annotated with function as type keyword list parameter (KarelKenens, PR [20094](https://github.com/python/mypy/pull/20094))
- Fix errors for raise NotImplemented (Shantanu, PR [20168](https://github.com/python/mypy/pull/20168))
- Don't let help formatter line-wrap URLs (Frank Dana, PR [19825](https://github.com/python/mypy/pull/19825))
- Do not cache fast container types inside lambdas (Stanislav Terliakov, PR [20166](https://github.com/python/mypy/pull/20166))
- Respect force-union-syntax flag in error hint (Marc Mueller, PR [20165](https://github.com/python/mypy/pull/20165))
- Fix type checking of dict type aliases (Shantanu, PR [20170](https://github.com/python/mypy/pull/20170))
- Use pretty callable formatting more often for callable expressions (Theodore Ando, PR [20128](https://github.com/python/mypy/pull/20128))
- Use dummy concrete type instead of `Any` when checking protocol variance (bzoracler, PR [20110](https://github.com/python/mypy/pull/20110))
- PEP 696: Fix swapping TypeVars with defaults (Randolf Scholz, PR [19449](https://github.com/python/mypy/pull/19449))
- Fix narrowing of class pattern with union type (Randolf Scholz, PR [19517](https://github.com/python/mypy/pull/19517))
- Do not emit unreachable warnings for lines that return `NotImplemented` (Christoph Tyralla, PR [20083](https://github.com/python/mypy/pull/20083))
- Fix matching against `typing.Callable` and `Protocol` types (Randolf Scholz, PR [19471](https://github.com/python/mypy/pull/19471))
- Make `--pretty` work better on multi-line issues (A5rocks, PR [20056](https://github.com/python/mypy/pull/20056))
- More precise return types for `TypedDict.get` (Randolf Scholz, PR [19897](https://github.com/python/mypy/pull/19897))
- Prevent false unreachable warnings for `final` instances that occur when strict optional checking is disabled (Christoph Tyralla, PR [20045](https://github.com/python/mypy/pull/20045))
- Check class references to catch non-existent classes in match cases (A5rocks, PR [20042](https://github.com/python/mypy/pull/20042))
- Do not sort unused error codes in unused error codes warning (wyattscarpenter, PR [20036](https://github.com/python/mypy/pull/20036))
- Fix `[name-defined]` false positive in `class A[X, Y=X]:` case (sobolevn, PR [20021](https://github.com/python/mypy/pull/20021))
- Filter SyntaxWarnings during AST parsing (Marc Mueller, PR [20023](https://github.com/python/mypy/pull/20023))
- Make untyped decorator its own error code (wyattscarpenter, PR [19911](https://github.com/python/mypy/pull/19911))
- Support error codes from plugins in options (Sigve Sebastian Farstad, PR [19719](https://github.com/python/mypy/pull/19719))
- Allow returning Literals in `__new__` (James Hilton-Balfe, PR [15687](https://github.com/python/mypy/pull/15687))
- Inverse interface freshness logic (Ivan Levkivskyi, PR [19809](https://github.com/python/mypy/pull/19809))
- Do not report exhaustive-match after deferral (Stanislav Terliakov, PR [19804](https://github.com/python/mypy/pull/19804))
- Make `untyped_calls_exclude` invalidate cache (Ivan Levkivskyi, PR [19801](https://github.com/python/mypy/pull/19801))
- Add await to empty context hack (Stanislav Terliakov, PR [19777](https://github.com/python/mypy/pull/19777))
- Consider non-empty enums assignable to Self (Stanislav Terliakov, PR [19779](https://github.com/python/mypy/pull/19779))

Typeshed updates

Please see [git log](https://github.com/python/typeshed/commits/main?after=ebce8d766b41fbf4d83cf47c1297563a9508ff60+0&branch=main&path=stdlib) for full list of standard library typeshed stub changes.

1.18.2

- Fix crash on recursive alias (Ivan Levkivskyi, PR [19845](https://github.com/python/mypy/pull/19845))
- Add additional guidance for stubtest errors when runtime is `object.__init__` (Stephen Morton, PR [19733](https://github.com/python/mypy/pull/19733))
- Fix handling of None values in f-string expressions in mypyc (BobTheBuidler, PR [19846](https://github.com/python/mypy/pull/19846))

Acknowledgements

Thanks to all mypy contributors who contributed to this release:

- Ali Hamdan
- Anthony Sottile
- BobTheBuidler
- Brian Schubert
- Chainfire
- Charlie Denton
- Christoph Tyralla
- CoolCat467
- Daniel Hnyk
- Emily
- Emma Smith
- Ethan Sarp
- Ivan Levkivskyi
- Jahongir Qurbonov
- Jelle Zijlstra
- Joren Hammudoglu
- Jukka Lehtosalo
- Marc Mueller
- Omer Hadari
- Piotr Sawicki
- PrinceNaroliya
- Randolf Scholz
- Robsdedude
- Saul Shanabrook
- Shantanu
- Stanislav Terliakov
- Stephen Morton
- wyattscarpenter

I’d also like to thank my employer, Dropbox, for supporting mypy development.

1.18.1

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.

Type caching optimizations have a small risk of causing regressions. When
reporting issues with unexpected inferred types, please also check if
`--disable-expression-cache` will work around the issue, as it turns off some of
these optimizations.

- 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))
- Optimize fixed-format deserialization (Ivan Levkivskyi, PR [19765](https://github.com/python/mypy/pull/19765))
- Use macros to optimize fixed-format deserialization (Ivan Levkivskyi, PR [19757](https://github.com/python/mypy/pull/19757))
- Two additional micro‑optimizations (Ivan Levkivskyi, PR [19627](https://github.com/python/mypy/pull/19627))
- Another set of micro‑optimizations (Ivan Levkivskyi, PR [19633](https://github.com/python/mypy/pull/19633))
- Cache common types (Ivan Levkivskyi, PR [19621](https://github.com/python/mypy/pull/19621))
- Skip more method bodies in third‑party libraries for speed (Ivan Levkivskyi, PR [19586](https://github.com/python/mypy/pull/19586))
- Simplify the representation of callable types (Ivan Levkivskyi, PR [19580](https://github.com/python/mypy/pull/19580))
- Add cache for types of some expressions (Ivan Levkivskyi, PR [19505](https://github.com/python/mypy/pull/19505))
- Use cache for dictionary expressions (Ivan Levkivskyi, PR [19536](https://github.com/python/mypy/pull/19536))
- Use cache for binary operations (Ivan Levkivskyi, PR [19523](https://github.com/python/mypy/pull/19523))
- Cache types of type objects (Ivan Levkivskyi, PR [19514](https://github.com/python/mypy/pull/19514))
- 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, PRs [19385](https://github.com/python/mypy/pull/19385) and [19462](https://github.com/python/mypy/pull/19462))
- Remove nested imports from the default plugin (Ivan Levkivskyi, PR [19388](https://github.com/python/mypy/pull/19388))
- Micro‑optimize type expansion (Jukka Lehtosalo, PR [19461](https://github.com/python/mypy/pull/19461))
- Micro‑optimize type indirection (Jukka Lehtosalo, PR [19460](https://github.com/python/mypy/pull/19460))
- Micro‑optimize the plugin framework (Jukka Lehtosalo, PR [19464](https://github.com/python/mypy/pull/19464))
- Avoid temporary set creation in subtype checking (Jukka Lehtosalo, PR [19463](https://github.com/python/mypy/pull/19463))
- Subtype checking micro‑optimization (Jukka Lehtosalo, PR [19384](https://github.com/python/mypy/pull/19384))
- Return early where possible in subtype check (Stanislav Terliakov, PR [19400](https://github.com/python/mypy/pull/19400))
- Deduplicate some types before joining (Stanislav Terliakov, PR [19409](https://github.com/python/mypy/pull/19409))
- Speed up type checking by caching argument inference context (Jukka Lehtosalo, PR [19323](https://github.com/python/mypy/pull/19323))
- Optimize binding method self argument type and deprecation checks (Ivan Levkivskyi, PR [19556](https://github.com/python/mypy/pull/19556))
- Keep trivial instance types/aliases during expansion (Ivan Levkivskyi, PR [19543](https://github.com/python/mypy/pull/19543))

Fixed‑Format Cache (Experimental)

Mypy now supports a new cache format used for faster incremental builds. It makes
incremental builds up to twice as fast. The feature is experimental and
currently only supported when using a compiled version of mypy. Use `--fixed-format-cache`
to enable the new format, or `fixed_format_cache = True` in a configuration file.

We plan to enable this by default in a future mypy release, and we'll eventually
deprecate and remove support for the original JSON-based format.

Unlike the JSON-based cache format, the new binary format is currently
not easy to parse and inspect by mypy users. We are planning to provide a tool to
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. (Using
`MypyFile.read(binary_data)` to inspect cache data may be sufficient to support
some use cases.)

This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/python/mypy/pull/19668), [19735](https://github.com/python/mypy/pull/19735), [19750](https://github.com/python/mypy/pull/19750), [19681](https://github.com/python/mypy/pull/19681), [19752](https://github.com/python/mypy/pull/19752), [19815](https://github.com/python/mypy/pull/19815)).

Flexible Variable Definitions: Update

1.18

We’ve just uploaded mypy 1.18.1 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).

Mypy Performance Improvements

1.17.1

* Retain `None` as constraints bottom if no bottoms were provided (Stanislav Terliakov, PR [19485](https://github.com/python/mypy/pull/19485))
* Fix "ignored exception in `hasattr`" in dmypy (Stanislav Terliakov, PR [19428](https://github.com/python/mypy/pull/19428))
* Prevent a crash when InitVar is redefined with a method in a subclass (Stanislav Terliakov, PR [19453](https://github.com/python/mypy/pull/19453))

Acknowledgements

Thanks to all mypy contributors who contributed to this release:

* Alexey Makridenko
* Brian Schubert
* Chad Dombrova
* Chainfire
* Charlie Denton
* Charulata
* Christoph Tyralla
* CoolCat467
* Donal Burns
* Guy Wilson
* Ivan Levkivskyi
* johnthagen
* Jukka Lehtosalo
* Łukasz Kwieciński
* Marc Mueller
* Michael J. Sullivan
* Mikhail Golubev
* Sebastian Rittau
* Shantanu
* Stanislav Terliakov
* wyattscarpenter

I’d also like to thank my employer, Dropbox, for supporting mypy development.

1.17

We’ve just uploaded mypy 1.17 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)).
Mypy is a static type checker for Python. This release includes new features 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).

Optionally Check That Match Is Exhaustive

Mypy can now optionally generate an error if a match statement does not
match exhaustively, without having to use `assert_never(...)`. Enable
this by using `--enable-error-code exhaustive-match`.

Example:

python
mypy: enable-error-code=exhaustive-match

import enum

class Color(enum.Enum):
 RED = 1
 BLUE = 2

def show_color(val: Color) -> None:
  error: Unhandled case for values of type "Literal[Color.BLUE]"
 match val:
     case Color.RED:
         print("red")


This feature was contributed by Donal Burns (PR [19144](https://github.com/python/mypy/pull/19144)).

Further Improvements to Attribute Resolution

This release includes additional improvements to how attribute types
and kinds are resolved. These fix many bugs and overall improve consistency.

* Handle corner case: protocol/class variable/descriptor (Ivan Levkivskyi, PR [19277](https://github.com/python/mypy/pull/19277))
* Fix a few inconsistencies in protocol/type object interactions (Ivan Levkivskyi, PR [19267](https://github.com/python/mypy/pull/19267))
* Refactor/unify access to static attributes (Ivan Levkivskyi, PR [19254](https://github.com/python/mypy/pull/19254))
* Remove inconsistencies in operator handling (Ivan Levkivskyi, PR [19250](https://github.com/python/mypy/pull/19250))
* Make protocol subtyping more consistent (Ivan Levkivskyi, PR [18943](https://github.com/python/mypy/pull/18943))

Fixes to Nondeterministic Type Checking

Previous mypy versions could infer different types for certain expressions
across different runs (typically depending on which order certain types
were processed, and this order was nondeterministic). This release includes
fixes to several such issues.

* Fix nondeterministic type checking by making join with explicit Protocol and type promotion commute (Shantanu, PR [18402](https://github.com/python/mypy/pull/18402))
* Fix nondeterministic type checking caused by nonassociative of None joins (Shantanu, PR [19158](https://github.com/python/mypy/pull/19158))
* Fix nondeterministic type checking caused by nonassociativity of joins (Shantanu, PR [19147](https://github.com/python/mypy/pull/19147))
* Fix nondeterministic type checking by making join between `type` and TypeVar commute (Shantanu, PR [19149](https://github.com/python/mypy/pull/19149))

Remove Support for Targeting Python 3.8

Mypy now requires `--python-version 3.9` or greater. Support for targeting Python 3.8 is
fully removed now. Since 3.8 is an unsupported version, mypy will default to the oldest
supported version (currently 3.9) if you still try to target 3.8.

This change is necessary because typeshed stopped supporting Python 3.8 after it
reached its End of Life in October 2024.

Contributed by Marc Mueller
(PR [19157](https://github.com/python/mypy/pull/19157), PR [19162](https://github.com/python/mypy/pull/19162)).

Initial Support for Python 3.14

Mypy is now tested on 3.14 and mypyc works with 3.14.0b3 and later.
Binary wheels compiled with mypyc for mypy itself will be available for 3.14
some time after 3.14.0rc1 has been released.

Note that not all features are supported just yet.

Contributed by Marc Mueller (PR [19164](https://github.com/python/mypy/pull/19164))

Deprecated Flag: `--force-uppercase-builtins`

Mypy only supports Python 3.9+. The `--force-uppercase-builtins` flag is now
deprecated as unnecessary, and a no-op. It will be removed in a future version.

Contributed by Marc Mueller (PR [19176](https://github.com/python/mypy/pull/19176))

Mypyc: Improvements to Generators and Async Functions

This release includes both performance improvements and bug fixes related
to generators and async functions (these share many implementation details).

* Fix exception swallowing in async try/finally blocks with await (Chainfire, PR [19353](https://github.com/python/mypy/pull/19353))
* Fix AttributeError in async try/finally with mixed return paths (Chainfire, PR [19361](https://github.com/python/mypy/pull/19361))
* Make generated generator helper method internal (Jukka Lehtosalo, PR [19268](https://github.com/python/mypy/pull/19268))
* Free coroutine after await encounters StopIteration (Jukka Lehtosalo, PR [19231](https://github.com/python/mypy/pull/19231))
* Use non-tagged integer for generator label (Jukka Lehtosalo, PR [19218](https://github.com/python/mypy/pull/19218))
* Merge generator and environment classes in simple cases (Jukka Lehtosalo, PR [19207](https://github.com/python/mypy/pull/19207))

Mypyc: Partial, Unsafe Support for Free Threading

Mypyc has minimal, quite memory-unsafe support for the free threaded
builds of 3.14. It is also only lightly tested. Bug reports and experience
reports are welcome!

Here are some of the major limitations:
* Free threading only works when compiling a single module at a time.
* If there is concurrent access to an object while another thread is mutating the same
object, it's possible to encounter segfaults and memory corruption.
* There are no efficient native primitives for thread synthronization, though the
regular `threading` module can be used.
* Some workloads don't scale well to multiple threads for no clear reason.

Related PRs:

* Enable partial, unsafe support for free-threading (Jukka Lehtosalo, PR [19167](https://github.com/python/mypy/pull/19167))
* Fix incref/decref on free-threaded builds (Jukka Lehtosalo, PR [19127](https://github.com/python/mypy/pull/19127))

Other Mypyc Fixes and Improvements

* Derive .c file name from full module name if using multi_file (Jukka Lehtosalo, PR [19278](https://github.com/python/mypy/pull/19278))
* Support overriding the group name used in output files (Jukka Lehtosalo, PR [19272](https://github.com/python/mypy/pull/19272))
* Add note about using non-native class to subclass built-in types (Jukka Lehtosalo, PR [19236](https://github.com/python/mypy/pull/19236))
* Make some generated classes implicitly final (Jukka Lehtosalo, PR [19235](https://github.com/python/mypy/pull/19235))
* Don't simplify module prefixes if using separate compilation (Jukka Lehtosalo, PR [19206](https://github.com/python/mypy/pull/19206))

Stubgen Improvements

* Add import for `types` in `__exit__` method signature (Alexey Makridenko, PR [19120](https://github.com/python/mypy/pull/19120))
* Add support for including class and property docstrings (Chad Dombrova, PR [17964](https://github.com/python/mypy/pull/17964))
* Don't generate `Incomplete | None = None` argument annotation (Sebastian Rittau, PR [19097](https://github.com/python/mypy/pull/19097))
* Support several more constructs in stubgen's alias printer (Stanislav Terliakov, PR [18888](https://github.com/python/mypy/pull/18888))

Miscellaneous Fixes and Improvements

* Combine the revealed types of multiple iteration steps in a more robust manner (Christoph Tyralla, PR [19324](https://github.com/python/mypy/pull/19324))
* Improve the handling of "iteration dependent" errors and notes in finally clauses (Christoph Tyralla, PR [19270](https://github.com/python/mypy/pull/19270))
* Lessen dmypy suggest path limitations for Windows machines (CoolCat467, PR [19337](https://github.com/python/mypy/pull/19337))
* Fix type ignore comments erroneously marked as unused by dmypy (Charlie Denton, PR [15043](https://github.com/python/mypy/pull/15043))
* Fix misspelled `exhaustive-match` error code (johnthagen, PR [19276](https://github.com/python/mypy/pull/19276))
* Fix missing error context for unpacking assignment involving star expression (Brian Schubert, PR [19258](https://github.com/python/mypy/pull/19258))
* Fix and simplify error de-duplication (Ivan Levkivskyi, PR [19247](https://github.com/python/mypy/pull/19247))
* Disallow `ClassVar` in type aliases (Brian Schubert, PR [19263](https://github.com/python/mypy/pull/19263))
* Add script that prints list of compiled files when compiling mypy (Jukka Lehtosalo, PR [19260](https://github.com/python/mypy/pull/19260))
* Fix help message url for "None and Optional handling" section (Guy Wilson, PR [19252](https://github.com/python/mypy/pull/19252))
* Display fully qualified name of imported base classes in errors about incompatible overrides (Mikhail Golubev, PR [19115](https://github.com/python/mypy/pull/19115))
* 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))
* Fix type extraction from `isinstance` checks (Stanislav Terliakov, PR [19223](https://github.com/python/mypy/pull/19223))
* Erase stray type variables in `functools.partial` (Stanislav Terliakov, PR [18954](https://github.com/python/mypy/pull/18954))
* Make inferring condition value recognize the whole truth table (Stanislav Terliakov, PR [18944](https://github.com/python/mypy/pull/18944))
* Support type aliases, `NamedTuple` and `TypedDict` in constrained TypeVar defaults (Stanislav Terliakov, PR [18884](https://github.com/python/mypy/pull/18884))
* Move dataclass `kw_only` fields to the end of the signature (Stanislav Terliakov, PR [19018](https://github.com/python/mypy/pull/19018))
* Provide a better fallback value for the `python_version` option (Marc Mueller, PR [19162](https://github.com/python/mypy/pull/19162))
* Avoid spurious non-overlapping equality error with metaclass with `__eq__` (Michael J. Sullivan, PR [19220](https://github.com/python/mypy/pull/19220))
* Narrow type variable bounds (Ivan Levkivskyi, PR [19183](https://github.com/python/mypy/pull/19183))
* Add classifier for Python 3.14 (Marc Mueller, PR [19199](https://github.com/python/mypy/pull/19199))
* Capitalize syntax error messages (Charulata, PR [19114](https://github.com/python/mypy/pull/19114))
* Infer constraints eagerly if actual is Any (Ivan Levkivskyi, PR [19190](https://github.com/python/mypy/pull/19190))
* Include walrus assignments in conditional inference (Stanislav Terliakov, PR [19038](https://github.com/python/mypy/pull/19038))
* Use PEP 604 syntax when converting types to strings (Marc Mueller, PR [19179](https://github.com/python/mypy/pull/19179))
* Use more lower-case builtin types in error messages (Marc Mueller, PR [19177](https://github.com/python/mypy/pull/19177))
* Fix example to use correct method of Stack (Łukasz Kwieciński, PR [19123](https://github.com/python/mypy/pull/19123))
* Forbid `.pop` of `Readonly` `NotRequired` TypedDict items (Stanislav Terliakov, PR [19133](https://github.com/python/mypy/pull/19133))
* Emit a friendlier warning on invalid exclude regex, instead of a stacktrace (wyattscarpenter, PR [19102](https://github.com/python/mypy/pull/19102))
* Enable ANSI color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant