'Trigger callbacks for ``attr`` on this object.
Args:
attr (str) :
old (object) :
new (object) :
Returns:
None'

def trigger(self, attr, old, new, hint=None, setter=None):

    def invoke():
        callbacks = self._callbacks.get(attr)
        if callbacks:
            for callback in callbacks:
                callback(attr, old, new)
    if (hasattr(self, '_document') and (self._document is not None)):
        self._document._notify_change(self, attr, old, new, hint, setter)
        self._document._with_self_as_curdoc(invoke)
    else:
        invoke()
