On Nov 16, 2019, at 13:13, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
> 
> It might be better to keep it as purely a context manager, and
> not load it down with any other baggage.

Doesn’t `closing` already take care of that (and other things besides files, 
too)?

I’m not really sure what problem we’re trying to solve here. Having a way to 
construct file objects without opening them, so you can do all the actual opens 
in a with statement, and there’s no easy way to get it wrong? (Which still 
wouldn’t really be true, because there’s always the trap of writing a generator 
function that uses a with that only cleans up if the generator is cleaned up…) 
Or breaking file objects up into as many orthogonal pieces as possible to see 
if there’s a better way to reassemble them?

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SXWNYP4QZPMUINZ5FOB2VQ3CUJQDY5SR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to