On Wed, Oct 14, 2009 at 6:05 PM, Neil Schemenauer <n...@arctrix.com> wrote:
> def __del__(): > print sys.version > > the global variable reference to 'sys' is not a reference on the GC > referencing counting sense. IOW, it does not result in a a Py_INCREF > while the function is not being executed and therefore should be > safe after the proposed change. Currently, it could result in 'None' > being printed. > Currently it throws an exception since "sys" is None. :-) Here is my understanding of the proposed procedure: 1. Replace modules in sys.modules with weakrefs 2. Run the garbage collector 3. Replace globals in any remaining modules with None 4. Run the garbage collector Is it possible for a __del__ method to be called in step 4 or not? I am still unclear on this point. :-) -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com