Observer pattern in python