[Python-Dev] Garbage collecting closures

Guido van Rossum guido@python.org
Mon, 14 Apr 2003 16:03:33 -0400

Paul, would finalizers have been run if you had included an explicit
gc.collect() call?

If so, I'd say that a sufficiently portable rule is that you can't
trust finalizers to run until GC is run (in Jython, gc.collect() isn't
how it is invoked though).

If gc.collect() didn't solve your problem, full documentation of
cycles would indeed be required.  However, I'm reluctant to do so
because this reveals a lot of information about the implementation
that I don't want to have to guarantee for future versions.

--Guido van Rossum (home page: http://www.python.org/~guido/)