[Python-ideas] Revised**5 PEP on yield-from

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 5 21:34:32 CET 2009


Ron Adam wrote:

> Could it be possible to design it so that the yield path of generators 
> are passed down or forwarded to sub-generators when they are called?

It's really the other way around -- you would need some way
of passing the yield path *up* to a generator's caller.

E.g. if A is yielding from B is yielding from C, then A needs
a direct path to C.

Possibly some scheme could be devised to do this, but I don't
feel like spending any brain cycles on it until the current
scheme is shown to be too slow in practice. Premature
optimisation and all that.

  --
Greg



More information about the Python-ideas mailing list