This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author petr.viktorin
Recipients Crowthebird, docs@python, petr.viktorin, vstinner
Date 2022-03-30.14:57:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
So. According to PEP 384 (which added all structs in the stable ABI, except Py_buffer), some structs are opaque and others have a few members exposed:

I will split the latter into 1) structs that have a few fields exposed mainly for backwards compatibility (which, of course, is very important here). Best practice is to treat them as opaque (use getters/setters):

- PyObject (ob_refcnt, ob_type)
- PyVarObject (ob_base, ob_size)

... and 2) structs for which all fields are part of the ABI (and the struct's size as well: for most of these as users are expected to provide arrays):

- PyMethodDef
- PyMemberDef
- PyGetSetDef
- PyModuleDefBase
- PyModuleDef
- PyStructSequence_Field
- PyStructSequence_Desc
- PyType_Slot
- PyType_Spec
- Py_buffer (new in 3.11)

The opaque structs continue to be:

- PyThreadState
- PyInterpreterState
- PyFrameObject
- symtable
- PyWeakReference
- PyLongObject
- PyTypeObject
Date User Action Args
2022-03-30 14:57:29petr.viktorinsetrecipients: + petr.viktorin, vstinner, docs@python, Crowthebird
2022-03-30 14:57:29petr.viktorinsetmessageid: <>
2022-03-30 14:57:29petr.viktorinlinkissue47115 messages
2022-03-30 14:57:29petr.viktorincreate