[Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

Nathaniel Smith njs at pobox.com
Mon Apr 29 20:43:35 EDT 2019

On Mon, Apr 29, 2019 at 5:01 PM Neil Schemenauer <nas-python at arctrix.com> wrote:
> As far as I understand, we have a similar problem already for
> gc.get_objects() because those static type objects don't have a
> PyGC_Head.  My 2-cent proposal for fixing things in the long term
> would be to introduce a function like PyType_Ready that returns a
> pointer to the new type.  The argument to it would be what is the
> current static type structure.  The function would copy things from
> the static type structure into a newly allocated type structure.

I doubt you'll be able to get rid of static types entirely, due to the
usual issues with C API breakage. And I'm guessing that static types
make up such a tiny fraction of the address space that merely tweaking
the percent up or down won't affect performance.

But your proposed new API would make it *way* easier to migrate
existing code to the stable ABI.


Nathaniel J. Smith -- https://vorpus.org

More information about the Python-Dev mailing list