Re: __getattribute__ for class object

2005-08-12 Thread Steven Bethard
Dan wrote: > Depending on what you want to do, it might be better to use properties > instead: > > class Meta(type): > x = property(lambda klass: 'Called for '+str(klass)) > > class Foo(object): > __metaclass__=Meta Also worth noting that you can inline the metaclass if you don't n

Re: __getattribute__ for class object

2005-08-12 Thread Dan
> > but if i want to have a __getattribute__ for class attributes > > Read something on metaclasses. Depending on what you want to do, it might be better to use properties instead: class Meta(type): x = property(lambda klass: 'Called for '+str(klass)) class Foo(object): __metaclass

Re: __getattribute__ for class object

2005-08-12 Thread Paolino
Sylvain Ferriol wrote: > hello > when i define __getattribute__ in a class, it is for the class instances > but if i want to have a __getattribute__ for class attributes > > how can i do that ? > Skating on thin ice eh.Read something on metaclasses. class Meta(type): def __getattribute__(kl

__getattribute__ for class object

2005-08-12 Thread Sylvain Ferriol
hello when i define __getattribute__ in a class, it is for the class instances but if i want to have a __getattribute__ for class attributes how can i do that ? sylvain -- http://mail.python.org/mailman/listinfo/python-list