[Python-ideas] Cofunctions PEP - Revision 4

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 12 14:51:01 CEST 2010

Nick Coghlan wrote:

> Without send() and throw(), an object is just an iterator, never a
> cofunction (as there is no way for it to make cooperative calls - you
> need the extra two methods in order to receive the results of any such
> calls).

There are plenty of uses for cofunctions that never send or
receive any values using yield, but just use it as a suspension
point. In that case, send() is never used, only next(). And
I suspect that use of throw() will be even rarer.


More information about the Python-ideas mailing list