On Mon, 12 Jan 2009 07:42:47 -0800, bieffe62 wrote:

> On 12 Gen, 14:45, Paul Rubin <http://phr...@nospam.invalid> wrote:
>> bieff...@gmail.com writes:
>> > >    class Foo (DynamicAttributes, object): pass
>>
>> > You cannot do that, but you can establish a fixed set of attributes
>> > by defining the __slot__ class variable.
>>
>> That is not what __slot__ is for.
> 
> 
> Really? It seems to work:

It works but it is not what `__slot__` was invented for.  Some call it a 
misuse of that feature if you use it to prevent adding attributes 
dynamically.  And it has some drawbacks when you inherit from such 
classes.

Ciao,
        Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to