I'm glad to see that everything old is new again. All the stuff being discussed nowadays, even up through PEP 492, was largely what I was trying to show in 2002 .... the syntax just got nicer in the intervening 13 years :-).
On Wed, May 6, 2015 at 10:57 AM, Guido van Rossum email@example.com wrote:
For those interested in tracking the history of generators and coroutines in Python, I just found out that PEP 342 https://www.python.org/dev/peps/pep-0342/ (which introduced send/throw/close and made "generators as coroutines" a mainstream Python concept) harks back to PEP 288 https://www.python.org/dev/peps/pep-0288/, which was rejected. PEP 288 also proposed some changes to generators. The interesting bit though is in the references: there are two links to old articles by David Mertz that describe using generators in state machines and other interesting and unconventional applications of generators. All these well predated PEP 342, so yield was a statement and could not receive a value from the function calling next() -- communication was through a shared class instance.
-- --Guido van Rossum (python.org/~guido)