Cython: C-Extensions for Python, Wiki
Cython is a language that makes writing C extensions for the Python language as easy as Python itself.
Cython is based on the well-known Pyrex, but supports more cutting edge functionality and optimizations.
Development of Cython is partly motivated by the needs of SAGE.
See our proposals for the Google Summer of Code 2011.
Release History and older versions.
Example (Mandelbrot fractal)
Unsupported Python features (aka TODO list)
Enhancement proposals (CEPs)
- Tips and Tricks
Embedding Python to create standalone Cython programs.
List Subclass Example Adding mathematical operations to subclassed built-in list.
Automatic .pxd/.pyx generation from C or C++ header files.
Fully supported easy-to-use test suite (see this post), including the normal CPython test suite.
- Easy installation and usage.
- Rich, accessible documentation. Make sure the examples are plenty and can be automatically tested.
- Make Cython part of the standard distribution of Python (like ctypes).
- Compile all Python code except for possibly some obvious exclusions, which will be worked out by developers.
- Very fast when the user explicitly declares types (but we're not going to make promises with type inference). Precise benchmarks.
- Mitigate or eliminate the need for users to invoke the Python/C API directly without sacrificing performance.
CategoryCythonDoc lists pages that are related to Cython documentation.
SAGE Days 4 talk highlighting some of the differences between Pyrex and SageX (the predecessor of Cython).