On Wed, 25 Jan 2017 07:16:24 -0800, Bob Kline wrote:

> The subject line pretty much says it all. Should the programmer close
> the file? If the programmer does that, and the user has asked that the
> file object be hooked up to standard in (or standard out) what will
> happen? If the programmer doesn't close it, does it get closed cleanly
> in the face of an exception?
> 
> Thanks!

i would think the principle is always the same

if you open a file close it behind you

using "with" should ensure this always happens
 




-- 
It is bad luck to be superstitious.
                -- Andrew W. Mathis
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to