All versions of Java require the user to close resources manually – usually handled in the finally block. Java 7 is about to get ARM (automatic resource management) blocks.
- Firstly I don’t see a finally block concept in python. Or do you close resources in the catch for each raised exceptions ?
- Is there a library that performs ARM in python ? If not, then what is the pythonic way to do ARM ?
There is a try: except: finally: in python.
You can also use the with: statement, which I believe is what you are after for ARM. These are called context managers. http://www.python.org/dev/peps/pep-0343/