[issue39573] Make PyObject an opaque structure in the limited C API

Serhiy Storchaka report at bugs.python.org
Fri Feb 7 06:31:10 EST 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

You have merged so much PRs today. What they do?

PyObject cannot just be made an opaque structure. The user code reads and writes its fields directly and via macros. This change would break working code.

We can encourage the user code to prepare to making PyObject an opaque structure. We need to provide a stable C API for access of PyObject fields for this. Note that there is a performance penalty of using functions instead of direct access, so you should have very good reasons to do this.

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list