C extension custom types in abi3 module

Robin Becker robin at reportlab.com
Thu Dec 8 10:35:55 EST 2022


On 08/12/2022 12:52, Robin Becker wrote:
> I am trying to split off reportlab C extensions to simplify installations and make use of more advanced packages.
> 
> A simple extension is easily converted to being an abi3 module. However, another has a custom type which uses the old 
> style mechanisms here
............
> 
> it looks like I have to use a different mechanism to setup custom types in the abi3 world.
> 
In the docs I see this

"Also, since PyTypeObject is only part of the Limited API as an opaque struct, any extension modules using static types 
must be compiled for a specific Python minor version."

So it seems I must switch to using a heap allocated type or keep compiling in the old way.


> I looked in Modules/xxlimited_35.c, but that seems much more complex and provides for a type which supports GC.
> 
> Are there any ABI3 examples using the old style strategy?
> -- 
> Robin Becker

-- 
Robin Becker



More information about the Python-list mailing list