Lines Matching refs:ref
62 def callback(self, ref):
77 wr = weakref.ref(o)
91 ref1 = weakref.ref(o, self.callback)
92 ref2 = weakref.ref(o, self.callback)
106 # (the most recently created ref is cleaned up first). This
113 self.ref()
115 self.ref = weakref.ref(c, callback)
116 ref1 = weakref.ref(c, callback)
136 ref = weakref.ref(o)
137 self.assertTrue(ref() is not None,
139 o2 = ref()
141 "<ref>() should return original object if live")
146 ref = weakref.ref(o, self.callback)
150 self.assertTrue(ref() is None,
155 ref1 = weakref.ref(o)
159 ref2 = weakref.ref(o)
165 ref1 = weakref.ref(o)
166 ref2 = weakref.ref(o)
170 "wrong weak ref count for object")
173 "wrong weak ref count for object after deleting proxy")
178 ref = weakref.ref(o)
246 # callback". The "no callback" ref and proxy objects are supposed
253 self.check_shared_without_callback(weakref.ref)
338 ref1 = weakref.ref(o)
339 ref2 = weakref.ref(o, self.callback)
359 ref1 = weakref.ref(o, self.callback)
360 ref2 = weakref.ref(o, self.callback)
366 ref1 = weakref.ref(o, self.callback)
367 ref2 = weakref.ref(o, self.callback)
398 data[weakref.ref(f, remove)] = None
430 wr = weakref.ref(c, lambda ignore: gc.collect())
438 wr = weakref.ref(c1.i, lambda ignore: gc.collect())
465 I.wr = weakref.ref(J, I.acallback)
517 I.wr = weakref.ref(J, I.acallback)
541 c2.wr = weakref.ref(c1, c2.cb)
569 c2.wr = weakref.ref(c1, c2.cb)
597 c1.wr = weakref.ref(c2, c1.acallback)
598 c2.wr = weakref.ref(c1, c2.acallback)
602 wr = weakref.ref(C, C_went_away)
636 c.wr = weakref.ref(d, callback) # this won't trigger
637 d.wr = weakref.ref(callback, d.cb) # ditto
638 external_wr = weakref.ref(callback, safe_callback) # but this will
659 self.check_gc_during_creation(weakref.ref)
681 # now make sure the object and the ref get labeled as
684 weakref.ref(referenced, callback)
697 ref_from_del = weakref.ref(self)
704 r = weakref.ref(Exception)
717 weakref.ref(int)
718 a = weakref.ref(A, l.append)
723 b = weakref.ref(B, l.append)
734 a = weakref.ref(x)
735 b = weakref.ref(y)
736 c = weakref.ref(z)
737 d = weakref.ref(x)
766 a = weakref.ref(x)
767 b = weakref.ref(y)
786 wself = weakref.ref(self)
789 self.wparent = weakref.ref(parent, cb)
802 class MyRef(weakref.ref):
819 class MyRef(weakref.ref):
823 r2 = weakref.ref(o)
836 class MyRef(weakref.ref):
847 class MyRef(weakref.ref):
850 return weakref.ref.__new__(type, ob, callback)
868 # the callback must not be called, because the ref object is
870 class MyRef(weakref.ref):
1305 >>> r = weakref.ref(obj)
1314 >>> r = weakref.ref(o)
1323 >>> class ExtendedRef(weakref.ref):