[issue40241] [C API] Make PyGC_Head structure opaque, or even more it to the internal C API

STINNER Victor report at bugs.python.org
Thu Apr 9 20:18:59 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

> The following macros rely on PyGC_Head: (...)

I already moved them to the internal C API in commit  1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076 of bpo-35081.

But Stefan Behnel reported that it breaks Cython:

"Making _PyGC_FINALIZED() internal broke Cython (https://github.com/cython/cython/issues/2721). It's used in the finaliser implementation (https://github.com/cython/cython/blob/da657c8e326a419cde8ae6ea91be9661b9622504/Cython/Compiler/ModuleNode.py#L1442-L1456), to determine if an object for which tp_dealloc() is called has already been finalised or whether we have to do it. I'm not sure how to deal with this on our side now. Any clue?"

https://bugs.python.org/issue35081#msg330045

So I simply reverted (partially) this change: commit 3e21ad1a254cc33e8d4920ad7f026254ec728bee.

----------

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


More information about the Python-bugs-list mailing list