MCPcopy Index your code
hub / github.com/RustPython/RustPython / remove_done_callback

Method remove_done_callback

Lib/asyncio/futures.py:242–253  ·  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

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

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 1

lenFunction · 0.85

Tested by

no test coverage detected