The Cython compiler for writing C extensions in the Python language.
Actively maintained. Last release 4 days ago, commits in 26 of the last 26 weeks. A safe choice.
$
pip install cythonThe Cython language makes writing C extensions for the Python language as
easy as Python itself. Cython is a source code translator based on Pyrex_,
but supports more cutting edge functionality and optimizations.
The Cython language is a superset of the Python language (almost all Python
code is also valid Cython code), but Cython additionally supports optional
static typing to natively call C functions, operate with C++ classes and
declare fast C types on variables and class attributes. This allows the
compiler to generate very efficient C code from Cython code.
This makes Cython the ideal language for writing glue code for external
C/C++ libraries, and for fast C modules that speed up the execution of
Python code.
The newest Cython release can always be downloaded from https://cython.org/.
Unpack the tarball or zip file, enter the directory, and then run::
pip install .
Note that for one-time builds, e.g. for CI/testing, on platforms that are not
covered by one of the wheel packages provided on PyPI *and* the pure Python wheel
that we provide is not used, it is substantially faster than a full source build
to install an uncompiled (slower) version of Cython with::
NO_CYTHON_COMPILE=true pip install .
.. _Pyrex: https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
3.3.2 (2026-11-25)
==================
Bugs fixed
----------
* Since Cython 3.3.0, parallel code following a ``prange()`` for-loop could start executing
before all loop iterations had finished.
Patch by Arthur Lacote. (Github issue https://github.com/cython/cython/issues/8120)
* A race condition in the auto-pickle code was fixed for freethreading builds.
(Github issue https://github.com/cython/cython/issues/8107)
* ``None`` default values passed into optimised string methods (as start/end position)
were mishandled and let the call fail.
(Github issue https://github.com/cython/cython/issues/8098)
* Decoding bytes literals in place crashed Cython.
Patch by 0z5a. (Github issue https://github.com/cython/cython/issues/8134)
* ``cython.collection_type()`` did not work in PyPy.
(Github issue https://github.com/cython/cython/issues/8133)
* Warnings about "implicit ``__init__.py`` creation" in Bazel builds were resolved.
Patch by David Sanderson. (Github issue https://github.com/cython/cython/issues/8132)
* ``Errors.close_listing_file()`` failed to clear the echo file reference,
allowing later writes to closed files.
Patch by Lumír Balhar. (Github issue https://github.com/cython/cython/issues/8128)
Other changes
-------------
* Limited API builds now explicitly use the ``Py_IncRef()`` / ``Py_DecRef()`` functions
instead of the respective macros to make it safer to use modules built for old Limited API
versions in CPython 3.14 and later.
(Github issue https://github.com/cython/cython/issues/8125)
* Cythonizing under GraalPython now avoids parallel jobs by default to limit the memory usage.
Patch by Michael Šimáček. (Github issue https://github.com/cython/cython/issues/8143)