Detect when a class member is updated

Mike C. Fletcher mcfletch at rogers.com
Wed Jan 15 16:49:48 EST 2003


Properties are, IMO, the great unsung feature of 2.2.x that should have 
_everyone_ move to it (the feature that everyone sings about, the 
type-class unification, is undeniably wonderful too, but everyone 
already sings about that).  Subclassed properties give you amazing power 
in automating data-driven Python applications.  They can:

    * interact with watchers, (update databases or GUIs on set/del, for
      example)
    * check data-types,
    * perform automatic value coercian (ingoing and outgoing),
    * linearise their own definitions (i.e. they can write themselves
      out to disk and be reloaded later to facilitate run-time-composed
      data-types (classes)),
    * provide attribute documentation (and other attributes/properties)
      to automate presentation,
    * automate object initialisers,
    * and provide default values/functions.

(Among other uses).

Hey, how did I get up on this box?
Mike

Boethius wrote:

>Gerhard Häring <gerhard.haering at opus-gmbh.net> wrote in message news:<slrnb2at1n.1hk.gerhard.haering at haering.opus-gmbh.net>...
>
>  
>
>>Note that properties only work with new-style classes (inherited from
>>object). See http://python.org/2.2.2/descrintro.html for details.
>>    
>>
>
>Thanks, this properties thing was totally unknown to me.
>  
>
_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/








More information about the Python-list mailing list