3 ms·
> That's a CPython implementation detail Which would be why I specifically wrote « in CPython ». And it still makes the original assertion completely incorrec
by masklinn 6y ago
> That's a CPython implementation detail
Which would be why I specifically wrote « in CPython ».
And it still makes the original assertion completely incorrect. Python destructors do not run « down the road, during the next GC cycle ». They may, in certain cases or implementations.
- Nullabillity 6y agoOnce again, > implementation detail There is no guarantee that even CPython will keep the current behaviour. Ultimately, the promise you're given is that __del__ might be invoked by the system some point between "the object has no live references" and "never". The original assertion gives a much closer intuition than your description of the current behaviour.