I'd like to resolve a long-standing issue of the stable ABI in 3.4: http://bugs.python.org/issue17162 The issue is that, since PyTypeObject is opaque, module authors cannot get at tp_free, which they may need to in order to implement tp_dealloc properly. Rather than providing the proposed specific wrapper for tp_dealloc, I propose to add a generic PyType_GetSlot function. From a stability point of view, exposing slot values is uncritical - it's just that the layout of the type object is hidden. Any objection to adding this before RC1? Regards, Martin
On 01/28/2014 12:27 AM, "Martin v. Löwis" wrote:
I'd like to resolve a long-standing issue of the stable ABI in 3.4:
http://bugs.python.org/issue17162
The issue is that, since PyTypeObject is opaque, module authors cannot get at tp_free, which they may need to in order to implement tp_dealloc properly.
Rather than providing the proposed specific wrapper for tp_dealloc, I propose to add a generic PyType_GetSlot function. From a stability point of view, exposing slot values is uncritical - it's just that the layout of the type object is hidden.
Any objection to adding this before RC1?
So this would be a new public ABI function? Would it be 100% new code, or would you need to refactor code internally to achieve it? In general I'm in favor of it but I'd like to review the patch before it goes in. Also, just curious: what is typeslots.h used for? I tried searching for a couple of those macros, and their only appearance in trunk was their definition. Cheers, //arry/
Am 29.01.14 03:46, schrieb Larry Hastings:
So this would be a new public ABI function?
Correct.
Would it be 100% new code, or would you need to refactor code internally to achieve it?
See the patch - it's new code.
Also, just curious: what is typeslots.h used for? I tried searching for a couple of those macros, and their only appearance in trunk was their definition.
It's meant for use by extension modules. See xxlimited.c:Xxo_Type_slots for an application. Regards, Martin
participants (2)
-
"Martin v. Löwis"
-
Larry Hastings