[Python-Dev] Better module shutdown procedure (original) (raw)
Daniel Stutzbach daniel at stutzbachenterprises.com
Thu Oct 15 01:27:37 CEST 2009
- Previous message: [Python-Dev] Better module shutdown procedure
- Next message: [Python-Dev] Better module shutdown procedure
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Oct 14, 2009 at 6:05 PM, Neil Schemenauer <nas at 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 PyINCREF 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:
- Replace modules in sys.modules with weakrefs
- Run the garbage collector
- Replace globals in any remaining modules with None
- 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> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20091014/9b3e8287/attachment.htm>
- Previous message: [Python-Dev] Better module shutdown procedure
- Next message: [Python-Dev] Better module shutdown procedure
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]