April 29, 2005
5:23 p.m.
On 4/29/05, Guido van Rossum <gvanrossum@gmail.com> wrote:
[Phillip J. Eby]
Although I'd personally prefer a no-keyword approach:
synchronized(self): with_file("foo") as f: # etc.
I'd like that too, but it was shot down at least once. Maybe we can resurrect it?
opening("foo") as f: # etc.
is just a beauty!
I agree, but does this then work: x = opening("foo") ...stuff... x as f: # etc ? And if not, why not? And if yes, what happens if "stuff" raises an exception?