Re: Multiple inheritance and __slots__

2006-12-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Simon Brunning wrote: >> On 14 Dec 2006 05:23:33 -0800, [EMAIL PROTECTED] >> <[EMAIL PROTECTED]> wrote: >>> Hi all, >>> >From the google search, it seems its not possible to do the following. >>> >> class Test1(object): >>> ... __slots__ = ['a'] >>> ... >> cla

Re: Multiple inheritance and __slots__

2006-12-14 Thread greg
Simon Brunning wrote: > Difficulty with subclassing is the price you pay for abusing slots. Although you could have the same difficulty even if you weren't abusing them. It's just a limitation of the implementation. The use of __slots__ forces a particular layout im memory, and you can only do t

Re: Multiple inheritance and __slots__

2006-12-14 Thread Michele Simionato
[EMAIL PROTECTED] wrote: > OK. But is there any other way to do what __slots__ does as a 'side > effect' i.e. forcing me to think about the list of attributes my class > is going to have upfront and raising error whenever I violate it. IMHO > this is a very good thing to have even if one does not c

Re: Multiple inheritance and __slots__

2006-12-14 Thread [EMAIL PROTECTED]
Simon Brunning wrote: > On 14 Dec 2006 05:23:33 -0800, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > Hi all, > > >From the google search, it seems its not possible to do the following. > > > > >>> class Test1(object): > > ... __slots__ = ['a'] > > ... > > >>> class Test2(object): > > ...

Re: Multiple inheritance and __slots__

2006-12-14 Thread Simon Brunning
On 14 Dec 2006 05:23:33 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all, > >From the google search, it seems its not possible to do the following. > > >>> class Test1(object): > ... __slots__ = ['a'] > ... > >>> class Test2(object): > ... __slots__ = ['b'] > ... > >>> class Tes

Multiple inheritance and __slots__

2006-12-14 Thread [EMAIL PROTECTED]
Hi all, >From the google search, it seems its not possible to do the following. >>> class Test1(object): ... __slots__ = ['a'] ... >>> class Test2(object): ... __slots__ = ['b'] ... >>> class Test3(Test1,Test2): ... __slots__ = ['c'] ... Traceback (most recent call last): File "", li