On Aug 17, 12:35 am, Michael Torrie <[EMAIL PROTECTED]> wrote: > However it's not necessary in python to do any of this, since you can > define nested functions that have access to the parent scope. Anytime > you need to clean up, just call the nested cleanup function and then return.
That is unnecessary and dangerous in Python. 98% of the time the Python interpreter cleans up what you would have had to clean up by hand in C. The rest of the time you should be using a try...finally block to guarantee cleanup, or a with block to get the interpreter do it for you. Calling a nested function to perform cleanup is prone to omission errors, and it doesn't guarantee that cleanup will happen if an exception is raised. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list