[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

da-woods report at bugs.python.org
Sat Apr 17 03:38:11 EDT 2021


da-woods <dw-git at d-woods.co.uk> added the comment:

Cython currently does an elaborate process of importing the GC module and loading the "isenabled", "enable" and "disable" attributes each time it creates a cdef type

https://github.com/cython/cython/blob/master/Cython/Utility/ExtensionTypes.c#L73-L107

Admittedly that's partly because it's abusing the Py_TPFLAGS_HEAPTYPE to allow multiple inheritance where Python doesn't really allow it.

But the up-shot is that Cython definite has a use-case for doing this directly in the C API, and would use these functions if provided.

----------
nosy: +da-woods

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28254>
_______________________________________


More information about the Python-bugs-list mailing list