Home | History | Annotate | Download | only in test

Lines Matching defs:callback

518         def callback(ignored):
522 WRs = [weakref.ref(c, callback) for c in Cs]
528 # the callback materialized a strong reference to an instance, but gc
534 # If the callback resurrected one of these guys, the instance
558 c2wr = weakref.ref(c2) # no callback!
561 def callback(ignored):
564 # The callback gets associated with a wr on an object in generation 2.
565 c0wr = weakref.ref(c0, callback)
572 # global weakref to c2 (c2wr), but that weakref has no callback.
574 # callback, and that callback references c2 via c2wr().
576 # c0 has a wr with callback, which references c2wr
584 # ^->c1 ^->c2 has a wr but no callback
589 # that c2 has a callback-free weakref, and c1 doesn't even have a
591 # the only object that has a weakref with a callback. gc clears c1
594 # and c0's wr callback triggers. That in turn materializes a reference
609 self.assertEqual(len(ouch), 1) # else the callback wasn't invoked
611 # If the callback resurrected c2, the instance would be damaged,
618 # callback to sneak in a resurrection of cyclic trash.
634 c2wr = weakref.ref(c2) # no callback!
641 # a global weakref to c2 (c2wr), but that weakref has no callback.
652 # ^->c1 ^->c2 has a wr but no callback
657 # that c2 has a callback-free weakref, and c1 doesn't even have a