[New-bugs-announce] [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 11:19:56 EDT 2020


New submission from STINNER Victor <vstinner at python.org>:

Similarly to bpo-39573 (PyObject) and bpo-40170 (PyTypeObject), I propose to make the PyGC_Head structure opaque in the C API.

See https://bugs.python.org/issue39573#msg361513 for the rationale. In short, my plan is to hide all implementation details from the C API.

The PyGC_Head structure caused ABI issues recently: bpo-39599 "ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure". Making the structure opaque would reduce the risk of such ABI issue. In fact, the reporter of bpo-39599 really require to access PyGC_Head structure to write a profiler, so this issue doesn't fix all use cases, but it should benefit to most people ;-) PyGC_Head structure will remain accessible via the internal C API which doesn't provide any backward compatibility warranty.

----------
components: C API
messages: 366064
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Make PyGC_Head structure opaque, or even more it to the internal C API
versions: Python 3.9

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


More information about the New-bugs-announce mailing list