'Return the function for the operation, or None.
Deleting the instance attribute unmasks the class attribute.'

def unregister(self, operation):

    if (operation in self._operations):
        function = self._operations[operation]
        del self._operations[operation]
        try:
            delattr(self.widget, operation)
        except AttributeError:
            pass
        return function
    else:
        return None
