Python 3.16.0a2 adds set operations to regex and makes uuid4 and uuid7 15-30x faster
The second developer preview of Python 3.16 is out. Savannah Ostrowski announced Python 3.16.0a2 on the Python Insider blog on 10 November as the second of seven planned alpha releases, intended for testing and not for production.
The schedule in the announcement sets the limits on what can still change. Features can be added until beta 1 on 4 May 2027 and may be modified or removed until the first release candidate on 27 July 2027. The final release is planned for 5 October 2027. The next alpha, 3.16.0a3, is due on 15 December, and the full schedule is in PEP 826.
The post lists the highlights so far compared with 3.15. The re module gains more expressive character classes: nested character sets, set operations such as intersection and difference, and matching characters by Unicode property, for example uppercase letters. Startup is faster, and several common operations, including garbage collection and the construction of built-in objects, have been optimised.
UUID generation gets a large speed-up. uuid4() and uuid7() now have C implementations that the release team measures at about 15 to 30 times faster than the pure Python versions in microbenchmarks. The ssl module adds support for Encrypted Client Hello when CPython is built against OpenSSL 4.0 or later. Error messages are improved, and CPython can now be built for tvOS, watchOS and visionOS, although the announcement notes these platforms are not yet part of the supported tiers in PEP 11.
The team asks library and application maintainers to test the alpha and report bugs on the CPython issue tracker. A fuller list of changes is in the What's New in Python 3.16 document.

Why it matters
For most projects the alpha matters in two places. The regular-expression changes alter what character classes can express, so code that builds patterns from untrusted input should be checked against the new syntax before 3.16 lands. And the faster uuid7() removes one argument for third-party UUID libraries in services that generate time-ordered identifiers at volume.