Re: Running code on assignment/binding

2006-06-20 Thread Michael Spencer
David Hirschfield wrote: > Another deep python question...is it possible to have code run whenever > a particular object is assigned to a variable (bound to a variable)? > > So, for example, I want the string "assignment made" to print out > whenever my class "Test" is assigned to a variable: >

Running code on assignment/binding

2006-06-20 Thread David Hirschfield
Another deep python question...is it possible to have code run whenever a particular object is assigned to a variable (bound to a variable)? So, for example, I want the string "assignment made" to print out whenever my class "Test" is assigned to a variable: class Test:    ... x = Test