Yes, if we rev the API completely, Py_OPAQUE_PYOBJECT will be useless.
But I’m afraid of making these removals block people from using other 3.15 features.
Granted!
Py_OPAQUE_PYOBJECT does nothing but hide APIs that are incompatible between regular and free-threaded builds.
For the record, the preliminary list is:
struct _object(makingPyObjectopaque)struct PyVarObject(makingPyVarObjectopaque)PyObject_HEAD_PyObject_EXTRA_INITPyObject_HEAD_INITPyObject_VAR_HEADPy_SIZE(can be exported as a function instead)Py_SET_TYPE(can be exported as a function instead)Py_SET_SIZE(can be exported as a function instead)- [edited to add]:
PyModuleDef_BasePyModuleDef_HEAD_INITPyModuleDef
I think your idea ties in nicely with my forward-compatible slots idea :)
If we do not rev the API completely, these can be added at any point.