
On Thu, Jul 2, 2020, at 16:04, William Pickard wrote:
The goal as it stands is to make PyObject an opaque type (interpreted to mean, "incomplete type"), but there is a blocking problem to accomplishing that.
Functions/Macros like PY_TYPE require a complete PyObject.
Is it acceptable if the performance hit only applies to external [not part of the python implementation] callers? The macro could be defined as to call an exported function from external code but as its current definition within the python implementation. I do think there's a much bigger problem, though... if PyObject is opaque, then extension modules cannot define their own types, since the definition of any extension type has to begin with PyObject_HEAD. It could be replaced by a "semi-opaque" definition of the same size and alignment, but would that solve whatever problem making PyObject opaque is intended to solve?