3 ms·
> Sure, you're saving a line with the files being automatically closed at the end of your scope That's actually pretty significant if you're, say, using Pypy o
by masklinn 14y ago
> Sure, you're saving a line with the files being automatically closed at the end of your scope
That's actually pretty significant if you're, say, using Pypy or IronPython, otherwise you're leaking handlers if you've got an error raised.
But he was actually comparing the code to:
with open('site.log') as infile:
with open('err.log', 'w') as outfile:
# code
. MIND=BLOWN is tongue-in-cheek. Hopefully. Then again, he's commenting on a 2 or 3 years old version of python so...