[Python-Dev] PEP 380 (yield from a subgenerator) comments

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 26 09:34:43 CET 2009


Nick Coghlan wrote:

> Although the PEP may still want to mention how one would write *tests*
> for these things. Will the test drivers themselves need to be generators
> participating in some kind of trampoline setup?

I don't see that tests are fundamentally different
from any other code that wants to call a value-returning
generator and get the value without becoming a generator
itself. So if it's to be mentioned in the PEP at all,
a general solution might as well be given (whether it's
to use a trampoline or just write the necessary next()
and except code).

-- 
Greg


More information about the Python-Dev mailing list