A good resource I recently read on this is this entry in Raymond Chen's blog:
http://blogs.msdn.com/b/oldnewthing/archive/2010/08/09/10047586.aspx Together with the following entry, which explains why the lifetime of the variable has nothing to do with the lifetime of the object, this should help you understand. You should consider automatically closing a file to be an implementation detail, even cpython may not respect such semantics in future. That is why the with statement was created. -- William Leslie _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
