
Feb. 19, 2009
5:16 p.m.
On Thu, Feb 19, 2009 at 5:12 AM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
* ``return expr`` in a generator is equivalent to ``raise StopIteration(expr)``.
It seems to me equivalence here might not be what you want. This parallel does not exist today between "return" and "raise StopIteration()", where the former can't be intercepted and blocked by a try/except block, but the latter can. I think it would be confusing for a return statement to be swallowed by code intended as an error handler. Greg F