(self, fn)
return removed_count
Remove all instances of a callback from the "call when done" list.

        Returns the number of callbacks removed.
Remove all instances of a callback from the "call when done" list.
Remove all instances of a callback from the call when done list .
def remove_done_callback(self, fn):
        """Remove all instances of a callback from the "call when done" list.

        Returns the number of callbacks removed.
        """
        filtered_callbacks = [(f, ctx)
                              for (f, ctx) in self._callbacks
                              if f != fn]
        removed_count = len(self._callbacks) - len(filtered_callbacks)
        if removed_count:
            self._callbacks[:] = filtered_callbacks
        return removed_count
def remove_done_callback ( self , fn ) : filtered_callbacks = [ ( f , ctx ) for ( f , ctx ) in self . _callbacks if f != fn ] removed_count = len ( self . _callbacks ) - len ( filtered_callbacks ) if removed_count : self . _callbacks [ : ] = filtered_callbacks return removed_count