-
- This document describes how to make extensions to the Python interpreter using CPython C API.
- Directly using the C API has many caveats - it is error prone to get the details, especially refcounting, right,
- only works well on the CPython interpreter and not say PyPy or any future Python implementation. There are multiple solutions
- that are easier to do and don't involve coding directly the C API. We recommend using one of the following 3rd party extensions:
-
- * Cython - incredibly popular in the numeric community, uses a language similar to Python with C level type
- annotations that directly compile to C. Can be used to extend Python types.
- * cffi - easy way to call C from Python without writing any C or learning a new language.
-
- However, if you feel you need to use the C API or you are working on the CPython implementation itself, this document
- will describe how to do it.
-