MCPcopy Index your code
hub / github.com/ipython/ipython / hold

Function hold

IPython/core/history.py:1112–1119  ·  view source on GitHub ↗

Context manger that hold a reference to a weak ref to make sure it is not GC'd during it's context.

(ref: ReferenceType[HistoryManager])

Source from the content-addressed store, hash-verified

1110
1111@contextmanager
1112def hold(ref: ReferenceType[HistoryManager]) -> Iterator[ReferenceType[HistoryManager]]:
1113 """
1114 Context manger that hold a reference to a weak ref to make sure it
1115 is not GC'd during it's context.
1116 """
1117 r = ref()
1118 yield ref
1119 del r
1120
1121
1122class HistorySavingThread(threading.Thread):

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…