Guido van Rossum wrote: > [Fredrik Lundh] > >>unlike the original design, all you get from this is >>the ability to add try/finally blocks to your code >>without ever writing a try/finally-clause (neither >>in your code or in the block controller). that >>doesn't strike me as especially pythonic. > > Would it be better if we pulled back in the generator exit handling > from PEP 340? That's a pretty self-contained thing, and would let you > write try/finally around the yield.
That would be good, in my opinion. I updated PEP 3XX to use this idea: http://members.iinet.net.au/~ncoghlan/public/pep-3XX.html With that update (to version 1.6), PEP 3XX is basically PEP 343, but injecting exceptions that occur into the template generator's internal frame instead of invoking next(). The rest of the PEP is then about dealing with the implications of allowing yield inside try/finally statements. The Rejected Options section tries to look at all the alternatives brought up in the various PEP 310, 340 and 343 discussions, and explain why PEP 3XX chooses the way it does. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.blogspot.com _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com