On 03/21/12 15:54, Chris Kaynor wrote:
As Chris Rebert pointed out, there is no guarantee as to when the __del__ method is called. CPython will generally call it immediately, however if there are reference cycles it may never call it
And more maddeningly, modules/objects used/called from within the __del__ may have already gone out of scope, producing head-scratching errors. I've been bitten by this enough times that I just stopped using __del__ completely.
-tkc -- http://mail.python.org/mailman/listinfo/python-list