A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-October/093037.html below:

[Python-Dev] Better module shutdown procedure

[Python-Dev] Better module shutdown procedure [Python-Dev] Better module shutdown procedureNeil Schemenauer nas at arctrix.com
Thu Oct 15 01:05:56 CEST 2009
On Wed, Oct 14, 2009 at 05:35:38PM -0500, Daniel Stutzbach wrote:
> 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 there is confusion about the word "reference". In the
method:

    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.

HTH,

  Neil
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4