(original) (raw)
On Wed, Oct 14, 2009 at 4:42 PM, Neil Schemenauer <nas@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