Lines Matching refs:weakref
4 The basic rule for dealing with weakref callbacks (and __del__ methods too,
23 attached to a reachable weakref W to an unreachable object O. Since O is
40 The primary thing it missed is that when a weakref to a piece of cyclic
42 materializing a strong reference to that weakref's CT referent, and so
45 weakref callback or __del__ method does something nasty on purpose: as
98 [That missed that, in addition, a weakref to CT can exist outside CT, and
99 any callback into Python can use such a non-CT weakref to resurrect its CT
108 [Except that a non-CT callback can also use a non-CT weakref to get at
111 More, if the callback itself is in cyclic trash, then the weakref to which
113 reason: if the weakref acted as an external root, then the callback could
116 So a problem here requires that a weakref, that weakref's callback, and the
130 a feature of Python's weakrefs too that when a weakref goes away, the
141 *almost* all the weakref callbacks that could get triggered by gc. The
142 problem remaining is that clearing a weakref with a callback decrefs the
144 via another weakref with another callback. So the process of clearing
158 tp_clear() on weakrefs with callbacks first. Instead the weakref module
160 tp_clear(): it removes the weakref from the weakly-referenced object's list
163 trigger, and (unlike weakref's tp_clear()) also prevents any callback
190 There's a big difference between __del__ and weakref callbacks.
199 Now, suppose some external code creates a weakref to one of your
208 Callbacks on weakref callbacks are executed in an arbitrary order, and
211 However, a weakref callback on a weakref callback has got to be rare.
218 them. People simply shouldn't try to use __del__ or weakref callbacks to