What's the best way to iniatilize a function

Gregor Horvath gh at gregor-horvath.com
Mon May 28 05:01:26 EDT 2007


Jack schrieb:

> I didn't call del explicitly. I'm expecting Python to call it when
> the program exits. I put a logging line in __del__() but I never
> see that line printed. It seems that __del__() is not being called
> even when the program exits. Any idea why?
> 
> 

http://effbot.org/pyfaq/my-class-defines-del-but-it-is-not-called-when-i-delete-the-object.htm

better solutions:

http://docs.python.org/ref/try.html
http://docs.python.org/whatsnew/pep-343.html

Gregor



More information about the Python-list mailing list