tp_base, ob_type, and tp_bases

Mark Wooding mdw at distorted.org.uk
Sat Jan 17 21:30:00 EST 2009


Jeff McNeil <jeff at jmcneil.net> writes:

> Thank you! It was tp_base that was confusing me.  The tp_bases member
> makes sense as Python supports multiple inheritance.  It wasn't
> immediately clear that tp_base is there for single inheritance
> reasons. It's all quite clear now.
>
> Is that an optimization of sorts?

I think it's a compatibility thing because types didn't acquire multiple
inheritance until the new-style class stuff started happening in,
ummm..., Python 2.2, I think.

This is rampant speculation.  Please correct me.

-- [mdw]



More information about the Python-list mailing list