[issue15528] Better support for finalization with weakrefs

Richard Oudkerk report at bugs.python.org
Sat Aug 11 21:17:39 CEST 2012


Richard Oudkerk added the comment:

> In the latest patch, what are "broken" and "priority" for?

They are for a subclass used by multiprocessing.  But it is premature to worry about subclassing, so I will take them out.

> Also, I would question why atexit is false by default. I would find it 
> personally less surprising to be true.

OK.

One thing I do worry about is having the loop in the exit function to run any finalizers created during the exit function.  The current implementation will run these extra finalizers at the wrong time.  Fixing this could probably be done by using a dirty flag and disabling gc while running the finalizers.

I wonder if it would be better to not call finalizers created during the exit function.  We cannot guarantee that every finalizer created during shutdown is run, so is a best effort attempt really worth the effort?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15528>
_______________________________________


More information about the Python-bugs-list mailing list