[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to create a C Extension that uses CPython internals (outside limited API)?

I'm working on a C extension for frozendict. To make it working, I had to:

1. add by hand the whole path of dictobject.c
2. add -DPy_BUILD_CORE
3. add the whole path of CPython includes
(/home/marco/sources/cpython/Include and so on)

This works on my machine, but I suspect that nobody will download the whole
CPython code and add the extra CFLAGS only to make it work.

What do I have to do? I have to copy the CPython source code that I need
inside my c extension folder? What if I also want to support CPython from
3.6 to 3.9?