Skip to content

PEP 803: Make PyObject opaque in Limited API 3.15 #92

@encukou

Description

@encukou

PEP 803 is a collection of smaller changes, most approved and implemented individually. See #69 and #72 for previous C API WG votes. Here is the final change to the C API that it proposes. See the PEP for context and rejected ideas.

Should we recommend that the SC approves the C API changes in PEP 803?
That is, starting with the next version of the Limited API (i.e. 3.15+, if nothing changes) should:

  • make the PyObject, PyVarObject, PyModuleDef_Base, PyModuleDef structs opaque
  • do not define the PyObject_HEAD, _PyObject_EXTRA_INIT, PyObject_HEAD_INIT, PyObject_VAR_HEAD, Py_SET_TYPE macros
  • make this version of Limited API & Stable ABI compatible with free-threading

(That is, you get the effect of defining _Py_OPAQUE_PYOBJECT in current main. I plan to implement it that way.)

Note that PEP 809 proposes the same changes (and more).

Metadata

Metadata

Assignees

No one assigned

    Labels

    voteThe WG is voting (or has voted)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions