Re: tp_base, ob_type, and tp_bases

2009-01-18 Thread Carl Banks
On Jan 17, 8:12 am, Jeff McNeil j...@jmcneil.net wrote: On Jan 17, 11:09 am, Jeff McNeil j...@jmcneil.net wrote: On Jan 17, 10:50 am, Martin v. Löwis mar...@v.loewis.de wrote: So, the documentation states that ob_type is a pointer to the type's type, or metatype. Rather, this is a

Re: tp_base, ob_type, and tp_bases

2009-01-18 Thread Jeff McNeil
On Jan 18, 5:40 am, Carl Banks pavlovevide...@gmail.com wrote: On Jan 17, 8:12 am, Jeff McNeil j...@jmcneil.net wrote: On Jan 17, 11:09 am, Jeff McNeil j...@jmcneil.net wrote: On Jan 17, 10:50 am, Martin v. Löwis mar...@v.loewis.de wrote: So, the documentation states that ob_type

tp_base, ob_type, and tp_bases

2009-01-17 Thread Jeff McNeil
. Anyways, I've been going through PyType_Ready as it sets up copies of PyObjectType, and I'm a bit confused by tp_base, ob_type, and tp_bases. I've been using http://docs.python.org/c-api/index.html as a guideline. So, the documentation states that ob_type is a pointer to the type's type

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Martin v. Löwis
So, the documentation states that ob_type is a pointer to the type's type, or metatype. Rather, this is a pointer to the new type's metaclass? That's actually the same. *Every* ob_type field points to the object's type, e.g. for strings, integers, tuples, etc. That includes type objects, where

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Jeff McNeil
On Jan 17, 10:50 am, Martin v. Löwis mar...@v.loewis.de wrote: So, the documentation states that ob_type is a pointer to the type's type, or metatype. Rather, this is a pointer to the new type's metaclass? That's actually the same. *Every* ob_type field points to the object's type, e.g.

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Jeff McNeil
On Jan 17, 11:09 am, Jeff McNeil j...@jmcneil.net wrote: On Jan 17, 10:50 am, Martin v. Löwis mar...@v.loewis.de wrote: So, the documentation states that ob_type is a pointer to the type's type, or metatype. Rather, this is a pointer to the new type's metaclass? That's actually the

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Terry Reedy
Martin v. Löwis wrote: So, the documentation states that ob_type is a pointer to the type's Next, we have tp_base. That's defined as an optional pointer to a base type from which type properties are inherited. The value of tp_base is then added to the tp_bases tuple. This is confusing me.

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Ned Deily
In article gktk5g$av...@ger.gmane.org, Terry Reedy tjre...@udel.edu wrote: Martin v. Löwis wrote: (I don't understand the English one in the same - interpreting it as as though they should be the same) Martin, you are not alone! I do not really understand that either. It's a non-standard

Re: tp_base, ob_type, and tp_bases

2009-01-17 Thread Mark Wooding
Jeff McNeil j...@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