try...except...finally problem in Python 2.5

Paul Rubin http
Wed Feb 14 22:01:22 EST 2007


Steven D'Aprano <steve at REMOVEME.cybersource.com.au> writes:
> Yes it does. Eventually f goes out of scope and is closed automatically.

Oh right, however you can't really predict when the closure occurs,
unless you're relying on current CPython artifacts.

Re your other post: yes, PEP 363 explains how the "with" statement
calls the __exit__ method.



More information about the Python-list mailing list