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.