def __init__(self, default_notify='handle_notify', threadsafe=False):
        """Construct an observable object.

        The `default_notify` parameter sets the named method to be called
        when sending an event to an observer.
        """
        self._observers = {}
        self._default_notify = default_notify;
        if (threadsafe):
            self.__obs_lock = Lock()
        else:
            self.__obs_lock = None
Construct an observable object.

        The `default_notify` parameter sets the named method to be called
        when sending an event to an observer.
        
recipes/Python/576962_Flexible_observer_pattern/recipe-576962.py