Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: > Okay, so would it be possible for a generator that > needs finalisation to set up a weakref callback, suitably > rooted somewhere so that the callback is reachable, > that references enough stuff to clean up after the > generator, without referencing the generator itself? I think so but it depends on what the finalizer needs to reference. If it references into the cycle then we are back to the same problem. I think you could also do the same thing with a sub-object that has the __del__ method. Maybe the generator would only create the sub-object if it needed to perform finalization. Neil
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