[Python-ideas] Revised^4 PEP on yield-from

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 19 21:36:52 CET 2009

Antoine Pitrou wrote:

> It should be relatively easy to avoid O(n**2) behaviour when traversing a tree,


> The problem I have with allowing "return" in generators is that it makes things
> much more confusing (try explaining a beginner that he has the right to return a
> value from a generator but the value can't be retrieved through any conventional
> means

I don't think it will be any harder than explaining why
they get a syntax error if they try to return something
from a generator at present.


More information about the Python-ideas mailing list