On Mon, 27 Oct 2014 14:36:31 +0100 Stefan Richthofer <stefan.richthofer at gmx.de> wrote: > Your test program performs no resurrection of x. > > Interestingly, it does not change behavior if you write > > class X(object): > def __del__(self): > X.x = self > print ref() > > (Thanks for making me aware of this! My test-case was already > initially the more complex one given below) > > But if the resurrection occurs indirectly, the weakref persists: It's not that resurrection occurs indirectly, it's that the object pointed to by "x2" always remains alive (first as an instance attribute of x, second as a class attribute of X *before x is deleted*). Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4