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
> > 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
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
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