[issue1918] weak references are removed before __del__ is called.

2008-01-23 Thread Jeff Foran
New submission from Jeff Foran: Not sure where to put example code, but here it goes: import weakref class MyObj(object): def __init__(self): self.ref = weakref.ref(self) def __del__(self): print "HERE123", self.ref() o = MyObj() o = None

[issue1918] weak references are removed before __del__ is called.

2008-01-23 Thread Christian Heimes
Christian Heimes added the comment: The behavior is documented in the C code. I don't know how it is described in the docs. Objects/typeobject.c around line 820 says: /* If we added a weaklist, we clear it. Do this *before* calling the finalizer (__del__), clearing slots, or clearing the in

[issue1918] weak references are removed before __del__ is called.

2008-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: Georg, can you update the docs? Weak references *to* an object are cleared before the object's __del__ is called, to ensure that the weak reference callback (if any) finds the object healthy. -- assignee: -> georg.brandl nosy: +georg.brandl, gvanross

[issue1918] weak references are removed before __del__ is called.

2008-03-22 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Done in r61733. -- status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-