3 Aug
2011
3 Aug
'11
1:41 a.m.
On Aug 2, 2011, at 3:11 PM, Mark McDuff wrote:
I find that I am often writing code in the following pattern:
foo = MyContextManager(*args) for bar in my_iter: with foo: # do stuff
I think it would be much cleaner to be able to write:
for bar in my_iter with MyContextManager(*args): # do stuff
It's not clear to me whether that means
for bar in my_iter: with MyContextManager(*args): # do stuff
or
with MyContextManager(*args): for bar in my_iter: # do stuff
-0.