Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 08:40 PM, Carl Banks wrote: I explained why in my last post; there's a bunch of reasons. Generally you can't assume someone's going to go through the type structure to find the object's dict, nor can you expect inherited methods to always use the derived class's type structure (some

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 3:11 pm, Rouslan Korneychuk wrote: > On 02/09/2011 04:58 PM, Carl Banks wrote: > > On Feb 9, 1:14 pm, Rouslan Korneychuk  wrote: > >> On 02/09/2011 02:42 PM, Carl Banks wrote: > >>> This is the only case I can think of where the > >>> layout conflict would be caused by a type setting tp_

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 05:02 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychuk wrote: Each Python class is a wrapper for a C++ class. Also, if you want my opinion (you probably don't after you've already gone to so much trouble, but here it is anyway): No, your opinion is quite welcome.

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 04:58 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychuk wrote: On 02/09/2011 02:42 PM, Carl Banks wrote: This is the only case I can think of where the layout conflict would be caused by a type setting tp_dictoffset. No, actually I have code that is roughly equivalent

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 1:14 pm, Rouslan Korneychuk wrote: > Each Python class is a wrapper for a C++ class. Also, if you want my opinion (you probably don't after you've already gone to so much trouble, but here it is anyway): It's not worth it to mimic the C++ type hierarchy in Python. Just wrap each C++ c

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 1:14 pm, Rouslan Korneychuk wrote: > On 02/09/2011 02:42 PM, Carl Banks wrote: > > This is the only case I can think of where the > > layout conflict would be caused by a type setting tp_dictoffset. > > No, actually I have code that is roughly equivalent to the following > pseudocode: >

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 02:42 PM, Carl Banks wrote: On Feb 9, 10:54 am, Rouslan Korneychuk wrote: I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and tp_dictoffset).

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 10:54 am, Rouslan Korneychuk wrote: > I'm working on a program that automatically generates C++ code for a > Python extension and I noticed a few limitations when using the weaklist > and instance dictionaries (tp_weaklistoffset and tp_dictoffset). This is > pertaining to the C API. > >

inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and tp_dictoffset). This is pertaining to the C API. I noticed that when using multiple inheritance, I need