Delaney, Timothy C (Timothy) wrote:
> Remember, finalisers are not called when Python exits. So if you don't
> explicitly close the file you are *writing* to, it may not be flushed
> before being closed (by the OS because the process no longer exists).

Wrong.

% python
Python 2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class ABC:
...   def __del__(self):
...     print "I am here!"
... 
>>> abc = ABC()
>>> del abc
I am here!
>>> abc = ABC()
>>> import sys
>>> sys.exit()
I am here!
% 

There's documentation somewhere that describes what occurs
during Python's exit, but I can't find it right now.

                                Andrew
                                [EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to