Message416370
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:
https://peps.python.org/pep-0384/#structures
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:29 | petr.viktorin | set | recipients:
+ petr.viktorin, vstinner, docs@python, Crowthebird |
2022-03-30 14:57:29 | petr.viktorin | set | messageid: <1648652249.87.0.50254400059.issue47115@roundup.psfhosted.org> |
2022-03-30 14:57:29 | petr.viktorin | link | issue47115 messages |
2022-03-30 14:57:29 | petr.viktorin | create | |
|