Éric Araujo <mer...@netwok.org> added the comment:

with also replaces open-try-do stuff-finally-close, the correct idiom for 
ensuring file handles are always closes in all VMs.

I don’t think the doc style guide is the right place, since this is a code 
issue.  with is advertised in 
http://docs.python.org/dev/tutorial/inputoutput#methods-of-file-objects and 
http://docs.python.org/dev/howto/doanddont#exceptions ; 
http://docs.python.org/dev/library/functions#open says nothing about closing, 
and http://docs.python.org/dev/library/io tells about the with statement 
without recommending it strongly.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10461>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to