MCPcopy Index your code
hub / github.com/python/cpython / remove_done_callback

Method remove_done_callback

Lib/asyncio/futures.py:246–257  ·  view source on GitHub ↗

Remove all instances of a callback from the "call when done" list. Returns the number of callbacks removed.

(self, fn)

Source from the content-addressed store, hash-verified

244 # New method not in PEP 3148.
245
246 def remove_done_callback(self, fn):
247 """Remove all instances of a callback from the "call when done" list.
248
249 Returns the number of callbacks removed.
250 """
251 filtered_callbacks = [(f, ctx)
252 for (f, ctx) in self._callbacks
253 if f != fn]
254 removed_count = len(self._callbacks) - len(filtered_callbacks)
255 if removed_count:
256 self._callbacks[:] = filtered_callbacks
257 return removed_count
258
259 # So-called internal methods (note: no set_running_or_notify_cancel()).
260

Callers 5

_waitFunction · 0.45
_cancel_and_waitFunction · 0.45
_handle_timeoutMethod · 0.45
_outer_done_callbackFunction · 0.45
run_until_completeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected