[Python-ideas] Do we need non-heap types any more? (Was: Implicit submodule imports)

Andrew Barnert abarnert at yahoo.com
Sat Sep 27 01:43:45 CEST 2014


On Sep 26, 2014, at 14:43, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Antoine Pitrou wrote:
>> The tp_dealloc for a heap type is not the same as the non-heap base
>> type's tp_dealloc.
>> Also, look at compatible_for_assignment(): it calls same_slots_added()
>> which assumes both args are heap types.
> 
> It looks like the easiest way to address this particular
> use case would be to make the module type a heap type.
> 
> In the long term, how about turning *all* types into
> heap types? We're already having to call PyType_Ready
> on all the static type objects, so allocating them
> from the heap shouldn't incur much extra overhead.
 
What about extension modules? Deprecate static types? Automatically copy them to heap types? Use some horrible macro tricks in Python.h or a custom preprocessor in distutils?


More information about the Python-ideas mailing list