Working with Cython
What Cython does is it translates a Python source code file into a C source code file containing equivalent calls to the Python C API; then it wraps it in the boilerplate necessary to turn it into a Python binary module.
This would be useful enough by itself, but Cython also allows us to inject calls in C functions and low-level data access operations into the module. The end result is that we could pretty much just write our compiled code as if it were Python and still gain the speed or low-level access that prompted our need to compile it in the first place.
The amount of work this saves us over using the Python API directly is considerable. The 100-line Python example included with this course translates into more than ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access