Michael Malinowski wrote:

> Apologies if this is a stupidly obvious or simple question. If I have a
> class with a series of attributes, is there a way to run a function
> definition in the class whenever a specific attribute is changed?

you can implement a __setattr__ hook, or, in Python 2.2 and newer, use
properties:

    
http://www.python.org/doc/2.2.3/whatsnew/sect-rellinks.html#SECTION000340000000000000000

note that "setter" properties only work if you inherit from "object".

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to