AI News Feed
Market watch
Products & Applications

Rust for CPython Proposes Optional Integration Starting With Python 3.16

A plan would add optional Rust code to CPython, starting with zlib in Python 3.16 in October 2027.

The Rust for CPython team is currently led by core developers Kirill Podoprigora and Emma Smith, who are authors of the Rust for CPython PEP draft. Emma Smith also spoke at PyCon US 2026 about the project. The team includes around 60 developers in a Discord channel, among them a few Python core developers and a delegation from the Rust project. The team has worked on previous projects that integrated Rust into existing codebases, including Android and the Linux kernel, and is excited by the work and keen to support the project if it proceeds.

Seth Larson, Python's security developer-in-residence, reported from the summit. He wrote that no one said 'don't do this' last year, after Hewitt had tested the waters at PyCon US 2025. The proposal would ask Python distributors to try optional Rust support in Python 3.16 in October 2027 and report platform-specific issues upstream in time to resolve them around the Python 3.17 timeline in October 2028.

The first Rust code to ship in Python would be in Python 3.16, where it would be completely optional, with existing C code kept as a fallback. The earliest Rust would become required to build CPython is Python 3.18 in 2029, at least three years away.

The team has selected the zlib module as the first module to receive an optional Rust implementation because it wanted to achieve a significant improvement with a small scope. The proposed Rust implementation would use zlib-rs, which is heavily tested and used by the Firefox, uv and Cargo projects and is faster than zlib and zlib-ng on many platforms. The change would have an impact because the zlib compression algorithm is widely used by Python packaging, meaning that almost every pip install in Python 3.16 would be sped up if the proposal is accepted.

David Hewitt showed how adopting Rust may specifically help CPython by noting that the number of issues labeled type-crash has been steadily rising over time. He explained that Jeff Vander Stoep described Rust in Android as 'move fast and fix things' and that Android has experienced fewer revisions for patches of the same size since adopting Rust.

One of the biggest concerns from a year ago was Rust's lack of platform support compared with CPython, which officially supports 20 different architectures and platforms at either Tier 1, 2 or 3. David Hewitt shared that Rust's support for different platforms has widened since last year and was becoming less and less of a concern.

Editor's Summary The Rust for CPython team is proposing optional Rust integration starting with zlib in Python 3.16 in 2027, with C code kept as a fallback and possible mandatory Rust by Python 3.18 in 2029. If accepted, the change could speed pip installs and reduce crash-related issues, while platform support concerns have eased.