Cython: C-Extensions for Python

3.2.4 · active · verified Sat Mar 28

Cython is an optimizing static compiler for both the Python programming language and the extended Cython programming language, making writing C extensions for Python as easy as Python itself. Current version: 3.2.4. Release cadence: Regular updates with active development and maintenance.

Warnings

Install

Imports

Quickstart

A simple example demonstrating the use of Cython's cfunc decorator to define a C function in Python.

import cython

@cython.cfunc
@cython.exceptval(-1)
def add(int x, int y):
    return x + y

print(add(2, 3))

view raw JSON →