In javascript, if I have an object that contains a method that wants to send a signal to outside the object, I might do something like this ...
function class1(arg1){
...
//something has happened - send out an alert
this.method1();
...
}
var obj1 = new class1();
//define function to respond to the request from obj1
obj1.method1 = function(){ ... }
Is there an equivalent way of doing this in python? (python 2).