Cython

Although technically, Cython (http://cython.org/) is not exactly an alternative to using the standard CPython interpreter, it will let us write Python code and compile it into C (something CPython doesn't do).

You'll see that Cython could be considered a transpiler, which simply means it's a piece of software meant to translate source code from one language into another. There are other similar products out there, such as CoffeeScript and Dart. Both are very different languages, and both are translated into JavaScript.

In our case, Cython translates a super set of Python (an extended version of the language) into optimized C/C++ code. Then, it's compiled into a Python extension module. This, in turn, allows the developer to:

  • Write Python code ...

Get Mastering Python High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.