[Python-Dev] exec/with thunk-handling proposal
Guido van Rossum
guido@python.org
Tue, 04 Feb 2003 10:37:26 -0500
> > This made me realize something. What happens if some sort of
> > exception is raised between 'f1 = open()' and the start of the
> > block 'with autoclose(f1):'?
> [...]
> > Please let me know what simple fact I'm missing.
>
> Nothing much, other than the fact that this is an issue with the
> try...except form as well. Basically, this isn't a problem that
> the proposal is trying to solve.
Actually, I care about this race condition, and for certain situations
I plan to solve it by implementing a bit of magic in C.
--Guido van Rossum (home page: http://www.python.org/~guido/)