[Python-ideas] Yield-from: Details to be decided

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 20 23:15:59 CET 2009


I've got to the point in the implementation where I
need to decide what to do if you send() a value to
a generator that's delegating to something that
doesn't have a send() method.

Possibilities include:

* Ignore the value and call next() instead

* Raise an exception

What do people think? I'm inclined to raise an
exception for the time being, since we can always
relax it later if we want. Also, doing so is more
consistent with the idea of the caller talking
directly to the sub-iterator.

-- 
Greg



More information about the Python-ideas mailing list