[Python-ideas] Cofunctions - Getting away from the iterator protocol

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Oct 31 22:41:38 CET 2011


Arnaud Delobelle wrote:
> Is it worth noting that the implementation in Python (*) that I posted
> earlier on does just that?  The costart generator function, when
> initiated, keeps track of the stack of suspended generators so that
> only the current one is accessed at any time.

Yes, I know that this can and has been done before using
generators. The important thing is that I'll be using a
new protocol that's separate from the generator protocol,
making it possible to use both together in a staightforward
and efficient way.

-- 
Greg




More information about the Python-ideas mailing list