Dynamic attributes

Alex Martelli aleaxit at yahoo.com
Thu Jan 18 11:53:11 EST 2001


"Miki Tebeka" <mtebeka at iil.intel.com> wrote in message
news:Pine.WNT.4.32.0101181556160.1644-100000 at haw2u1320...
> Hello All,
>
> Is there an "official" way to do the following?

If I get your meaning correctly, the 'official' hooks
you have to implement in your DynAttribs mixin are
__getattr__ and __setattr__ -- they can look into your
dictionary to get the methods to call for get/set
purposes.  Take care about naming things with leading
'__' (double underscores) if you don't know all of the
implications -- use a single underscore to indicate
'private [by-convention]'.


Alex






More information about the Python-list mailing list