We've got the first version of boom nailed, but we've got the same problem in handle_finalizers(). The version of boom below doesn't blow up until the second time the has_finalizer() is called. I don't understand the logic in handle_finalizers(), though. If the objects are all in the finalizers list, why do we call has_finalizer() a second time? Shouldn't everything has a finalizer at that point? Jeremy import gc class C: def __init__(self): self.x = 0 def delete(self): print "never called" def __getattr__(self, attr): self.x += 1 print self.x if self.x > 1: del self.attr else: return self.delete raise AttributeError a = C() b = C() a.attr = b b.attr = a del a, b print gc.collect()
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