1 Mar
2009
1 Mar
'09
3:45 p.m.
Calvin Spealman wrote:
On Sun, Mar 1, 2009 at 4:01 PM, Gregory P. Smith <greg@krypto.org> wrote:
Alternatively if closer conformity with for loop syntax is desirable consider this: with lock, open(infile), open(outfile) as lock, fin, fout: fout.fwrite(fin.read())
+1
We don't have multi-assignment statements in favor of the unpacking concept, and I think it carries over here. Also, as mentioned, this goes along with the lack of any multi-for statement. The `x as y` part of the with statement is basically an assignment with extras, and the original suggestion then combines multiple assignments on one line. This option, I think, is more concise and readable.
I prefer this also, for the same reasons. tjr