[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
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
[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
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):
> > ...
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
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