On 2009-09-25, Piet van Oostrum <p...@cs.uu.nl> wrote: >>>>>> exar...@twistedmatrix.com (e) wrote: > >>e> I specifically left out all "yield" statements in my version, since that's >>e> exactly the point here. :) With "real" coroutines, they're not necessary - >>e> coroutine calls look just like any other call. With Python's enhanced >>e> generators, they are. > > The first time I encountered coroutines was in Simula-67. Coroutine > switching was certainly explicit there. IIRC, the keyword was resume.
I'm not sure exactly what "coroutine calls" refers to, but the "mis-feature" in Python co-routines that's being discussed is the fact that you can only yeild/resume from the main coroutine function. You can't call a function that yields control back to the other coroutine(s). By jumping through some hoops you can get the same effect, but it's not very intuitive and it sort of "feels wrong" that the main routine has to know ahead of time when calling a function whether that function might need to yield or not. -- Grant Edwards grante Yow! Where does it go when at you flush? visi.com -- http://mail.python.org/mailman/listinfo/python-list