[Python-Dev] Better module shutdown procedure
daniel at stutzbachenterprises.com
Thu Oct 15 00:35:38 CEST 2009
On Wed, Oct 14, 2009 at 4:42 PM, Neil Schemenauer <nas at arctrix.com> wrote:
> Yes, it does still resort to setting globals to None. However, the
> weakref step makes it much more likely that __del__ methods run
> before that happens. After this change, referencing global variables
> from __del__ methods is okay.
The first and last sentences seem like a contradiction to me. If I cannot
guarantee that globals will be valid when __del__ is executed, then I must
not reference globals from __del__.
I think I'm missing something here. Is there some way the programmer can
determine that referencing a global variable in __del__ will be 100% safe?
(not just "likely")
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev