On Sat, Jul 4, 2020, at 13:22, William Pickard wrote:
Oh and the other question:
Yes, a conversion function will be required to utilize the value of the offset member, the conversion is sadly a one way affair BUT CPython's C API is handy enough that a sacrificial 'PyObject *' stack variable can exist, most compilers may end up just optimizing the variable away anyhow.
hmm... If only single inheritance is still allowed, there's no reason you couldn't support the other direction by subtracting the offset. Supporting multiple inheritance [of two different base classes that both define structures, anyway - something that's not currently allowed in cpython, but might be interesting to add support for] would require knowing the runtime type of the object, but I don't think your code is currently doing anything to support that case.