Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. Pyrex is a
programming language developed to aid in creating Python modules. Its
syntax is very close to Python, with the aim of making it easy for
Python programmers to write the non-Python code usually required for
such modules in a language which at least is very close. Python itself
only provides a C API to write extension modules, which allows writing
of functions and datatypes in C. These can then be accessed from Python.
It is thus also possible to wrap the functions and datatypes of existing
C libraries as Python objects and therefore make them available to
Python. There are tools like SWIG or Python's foreign function library
ctypes which can be used for this task without requiring much additional
code, but this is limited to making an external library available in
Python code. If adjustments to the API are needed, glue code must again
be written manually. This is where Pyrex fits in.