[Python-ideas] Why not break cycles with one del? (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Mon Sep 13 19:05:49 CEST 2010


On Mon, 13 Sep 2010 12:16:36 -0400 Jim Jewett <jimjjewett at gmail.com> wrote:

The last time I checked, there were proposals toeither add a close or weaken del to handle multi-del cycles -- but single-del cycles were already handled OK.

They aren't:

class C(list): ... def del(self): pass ... c = C() c.append(c) del c import gc gc.collect() 1 gc.garbage [[[...]]] type(gc.garbage[0]) <class '__main__.C'>



More information about the Python-ideas mailing list