Cython 3.0: The next generation of Python at the speed of C

Cython, the Python library for compiling Python code to C, has at last released version 3.0 after many years of development and refinement.

The main goal behind Cython is to make it easier to write C extensions for Python, whether for speed or to author convenient interfaces to C libraries. In many ways Cython 3 cleans up and modernizes Cython. It drops support for the long-obsolete Python 2, adds support for newer Python features (up to Python 3.12), and expands the use of “pure Python mode.”

Pure Python mode allows Python developers to use their existing Python linting and code analysis tools on Cython. Historically, Cython used its own peculiar syntax, a hybrid of Python syntax and the C type declaration syntax, which made Cython hard to troubleshoot with Python tooling. Over time Cython began offering an alternative syntax that was fully compatible with conventional Python syntax, called pure Python mode. The vast majority of Cython functions are now exposed in pure Python mode, including functions for calling external C libraries.

To read this article in full, please click here