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.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/RNLTR3A6GVZIOM7JJM7FLXJ3TK4OVLJW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to