properties + types, implementing meta-class desciptors elegantly?

Michele Simionato mis6 at
Sat Jul 19 16:40:52 CEST 2003

bokr at (Bengt Richter) wrote in message news:<bfa97g$s5j$0 at>...
> Not sure exactly what you are doing, but what does
>      object.__setattr__(client,, value)
> do in your context in place of
>      client.__dict__[ ] = value
> ?
> Regards,
> Bengt Richter

I agree with Bengt, from your traceback it seems you are assigning directly
to client.__dict__, but you cannot do that (I think because client.__dict__
is a dictproxy object and not a real dictionary). The right way to
go is via object.__setattr__ , or type.__setattr__ in the case of

I guess you are aware of the metaclass+properties recipes in the
on-line cookbook, but just in case ...



More information about the Python-list mailing list