Opposite of yield?

Erik Max Francis max at alcyone.com
Wed Sep 10 15:59:33 EDT 2003


achrist at easystreet.com wrote:

> The yield statement looks to be a big step toward some kind of
> lightweight concurrency-oriented programming in python.  Is there
> any similarly nice way to do the opposite of yield, just sit around
> (perhaps in the middle of a loop) and wait until some other routine
> (unknown to the waiting module) hurls a value in?

Yep:

	generator.next()

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Dead men have no victory.
\__/  Euripides




More information about the Python-list mailing list