I was reading a book on Python on my plane trip. I come from C++. The book was describing how to read files. I described the with keyword and said that the file would close when the block's scope was exited.
The book didn't go into details on how 'close()' actually got called. To me, this implies something akin to a destructor in the file object class. The with looks like a 'using' in C#. Am I correct? Did the book just skip over the details to keep it simple? Is there some manner of destructor or finalizer in python that I should be aware of and study up on?