[Guido van Rossum] > >- Paul Moore wants the generator templates to explicitly contain > > try/finally (or try/except, depending on the use case). That's much > > more work though (passing exceptions into a generator is a new > > feature) and is not necessary to get the "redux" version.
[Phillip J. Eby] > Uh oh. Speaking on behalf of the "coroutine-y people" :), does this mean > that we're not going to get the ability to pass exceptions into generators? That would be a separate proposal (PEP 288 or PEP 325). The do/with statement with its __enter__ and __exit__ APIs is entirely independent from generators. Having shown a few non-generator do/with wrappers I'm not so sure there's a lot of need for generators here; especially since generators will always have that round-peg-square-hole feeling when they're used in a non-looping context. But I still want to leave the door open for using generators as do/with-templates, hence my modification of PEP 310 (otherwise we could just accept PEP 310 as is and be done with it). For coroutines, see PEP 342. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ 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