Speeding up Python's exit

Devin Jeanpierre jeanpierreda at gmail.com
Thu Feb 28 12:31:10 EST 2013


On Thu, Feb 28, 2013 at 12:06 PM, Chris Angelico <rosuav at gmail.com> wrote:
> Is it any different if you create a deliberate reference loop and then
> stuff it into some module somewhere? That would force it to be kept
> until interpreter shutdown, and then a cyclic garbage collection after
> that, which quite probably would be never run. A stupid trick,
> perhaps, but it might work; I tested it with a dummy class with a
> __del__ method and it wasn't called. Putting it into some other module
> may not be necessary, but I don't know what happens with the
> interactive interpreter and what gets freed up when.

__del__ is never called for cyclic references.

-- Devin



More information about the Python-list mailing list