forcing a definition to be called on attribute change

Michael Malinowski michael at guerrilla-games.com
Tue Oct 24 04:39:09 EDT 2006


Hey All, 
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?

Something like the following 

class cSphere() :
	
	def __init__(self):
		Self.myAttr = 0

	def runThisFunctionWhenMyAttrChanged() :
		Pass




Thanks

Mike.




More information about the Python-list mailing list