>> That doesn't work. For variable-sized objects, it would need
>> to be ob_base.ob_base.ob_type.
> 
> I was wondering about that. It seems that each level
> of inheritance is going to add another level of
> required member access. Or is it legal to short-
> circuit all that and just cast directly to the
> ultimate base object?

As the PEP explains: you can cast a struct pointer to pointer
to the first field. That works recursively: if the first field
is a struct again, you can also cast to a pointer to that
struct's first field.

Regards,
Martin
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to