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

P.J. Eby pje at telecommunity.com
Fri Mar 27 05:17:39 CET 2009


At 04:08 PM 3/27/2009 +1300, Greg Ewing wrote:
>You can't expect to improve something like that by
>stuffing yield-from into the existing framework, because
>the point of yield-from is to render the framework
>itself unnecessary.

But it doesn't.  You still need *something* that processes the 
yielded values, since practical frameworks have various things to 
yield "to" - i/o, time, mouse clicks, whatever.  Correctly dealing 
with the call stack part is tedious to implement, sure, but it's not 
really the focal point of a microthreading framework.

Usually, you need to have some way to control which microthreads are 
actually to be executing, vs. the ones that are waiting for a 
particular time, an I/O operation, or some other sort of event.  None 
of that stuff goes away just by taking care of the call stack.



More information about the Python-Dev mailing list