[PyQt] SIP and PyPy

Matti Picus matti.picus at gmail.com
Thu Oct 20 20:37:01 BST 2016

I am a PyPy dev, working on making our C-API layer compatible with CPython.
I spent some time with SIP today, trying to make the wxPython bindings work.
I am using the latest HEAD version of PyPy and, AFAICT the 4.8.1 version 
of SIP.
I have a problem with the tp_alloc functions in siplib.c, specifically 
sipEnumType_alloc and sipWrapperType_alloc.
According to the C-API documentation, 
"Do not use this function to do any other instance initialization, not 
even to allocate additional memory; that should be done by tp_new" but 
these functions do much more.
Presently PyPy does not allow overriding the tp_alloc function at all, 
so from my perspective all the more reason to be pedantic about not 
doing too much in tp_alloc :).

My questions are: how can I work with the SIP people to make SIP work 
with PyPy (is there a test suite, continuous build or something like 
that), and more specifically would you be willing to accept a patch to 
move the initialization code from tp_alloc to tp_init? What are the 
implications for other users of SIP?
|| <https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_new>

More information about the PyQt mailing list