I've written this small class in Pyhon that wraps bound methods but does not prevent the deletion of self. Do you have any though on my code? Do you think I handle errors appropriately? Is it missing anything, what should be done to make it more robust? Is the documentation clear enough? import weakref class WeakBoundMethod: """ Wrapper around a method bound to a class instance. As opposed to bare bound methods, it holds only a weak reference to the `self` object, allowing it to be deleted. This can be useful when implementing certain kinds of systems that manage callback functions, such as an event manager. """ def __init__(self, meth): """ Initializes the class instance. It should be ensured that methods passed through the `meth` parameter are always bound methods. Static or class methods, and free functions will produce an `AssertionError`. """ assert (hasattr(meth, '__func__')), 'Parameter is not a bound method.' assert (hasattr(meth, '__self__')), 'Parameter is not a bound method.' self._self = weakref.ref(meth.__self__) self._func = meth.__func__ def __call__(self, *args, **kwargs): """ Calls the bound method and returns whatever object the method returns. Any arguments passed to this will also be forwarded to the method. In case an exception occurs, it will be caught and thrown again to the caller of this `WeakBoundMethod` object. It should be ensured that the `WeakBoundMethod` is never called on a deleted object; an `AssertionError` occurs otherwise. """ assert (self._self() is not None), \ 'Called `WeakBoundMethod` on deleted object.' try: return self._func(self._self(), *args, **kwargs) except Exception, e: raise e