14 Jun
2013
14 Jun
'13
5:34 p.m.
On Wed, 5 Jun 2013 09:10:54 -0700 Benjamin Peterson <benjamin@python.org> wrote:
I (and Guido) are accepting PEP 442 (Safe object finalization) on the condition that finalizers are only ever called once globally.
Ok, so there's an issue with that condition: it can't be upholded on non-GC objects. Creating a non-GC object is quite obscure and rare, though, since it requires basically a class with no __dict__ and an empty __slots__: class C: __slots__ = () survivors = [] def __del__(self): self.survivors.append(self) In this case, a C instance's __del__ will be called every time destruction is attempted, not only once. Is that a realistic problem? Regards Antoine.