zlacker

[parent] [thread] 3 comments
1. sgarla+(OP)[view] [source] 2025-08-22 11:42:03
I love Python, but the sheer number of caveats and warnings for __del__ makes me question if this person has ever read the docs [0]. My favorite WTF:

> It is possible (though not recommended!) for the __del__() method to postpone destruction of the instance by creating a new reference to it. This is called object resurrection.

[0]: https://docs.python.org/3/reference/datamodel.html#object.__...

replies(1): >>guappa+f2
2. guappa+f2[view] [source] 2025-08-22 11:58:23
>>sgarla+(OP)
How does this relate to the claim of the parent comment that cyclic structures are never freed in python (which is false, btw)?
replies(2): >>sgarla+B2 >>baq+O4
◧◩
3. sgarla+B2[view] [source] [discussion] 2025-08-22 12:01:49
>>guappa+f2
When I replied, the only thing the comment said was “yeah no.” I was agreeing that __del__ is fraught with peril.

Reading: cyclic GC, yes, the section I linked explicitly discusses that problem, and how it’s solved.

◧◩
4. baq+O4[view] [source] [discussion] 2025-08-22 12:18:45
>>guappa+f2
this is not what I claim, BTW.
[go to top]