Greg Ewing wrote: ...
You deal with it by not relying on __del__ for anything that needs to be done promptly. There are always alternatives: e.g. file objects have a close() method, and the "with" statement was invented to make it easy to do these kinds of things properly.
By the way, I was very impressed back in the day when the with statement and context manager protocol appeared in Python. I've always wondered from what language(s) it was borrowed from (as most of good ideas in Python have been borrowed, like comprehension from Haskell, and so on, which is good). -- https://mail.python.org/mailman/listinfo/python-list