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

Class GC_Detector

Lib/test/test_gc.py:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 self.loop = self
51
52class GC_Detector(object):
53 # Create an instance I. Then gc hasn't happened again so long as
54 # I.gc_happened is false.
55
56 def __init__(self):
57 self.gc_happened = False
58
59 def it_happened(ignored):
60 self.gc_happened = True
61
62 # Create a piece of cyclic trash that triggers it_happened when
63 # gc collects it.
64 self.wr = weakref.ref(C1055820(666), it_happened)
65
66@with_tp_del
67class Uncollectable(object):

Callers 4

test_bug1055820cMethod · 0.85
test_bug1055820dMethod · 0.85
test_threshold_zeroMethod · 0.85

Calls

no outgoing calls

Tested by 4

test_bug1055820cMethod · 0.68
test_bug1055820dMethod · 0.68
test_threshold_zeroMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…