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

Function wrap_future

Lib/asyncio/futures.py:415–425  ·  view source on GitHub ↗

Wrap concurrent.futures.Future object.

(future, *, loop=None)

Source from the content-addressed store, hash-verified

413
414
415def wrap_future(future, *, loop=None):
416 """Wrap concurrent.futures.Future object."""
417 if isfuture(future):
418 return future
419 assert isinstance(future, concurrent.futures.Future), \
420 f'concurrent.futures.Future is expected, got {future!r}'
421 if loop is None:
422 loop = events.get_event_loop()
423 new_future = loop.create_future()
424 _chain_future(future, new_future)
425 return new_future
426
427
428def future_add_to_awaited_by(fut, waiter, /):

Callers

nothing calls this directly

Calls 5

isfutureFunction · 0.85
isinstanceFunction · 0.85
_chain_futureFunction · 0.85
get_event_loopMethod · 0.45
create_futureMethod · 0.45

Tested by

no test coverage detected