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

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


Ron Adam wrote:
> If we put some strict requirements on the idea.
> 
>     1. Only have a *SINGLE* exception type as being resumable.
> 
>     2. That exception should *NEVER* occur naturally.
> 
>     3. Only allow continuing after it's *EXPLICITLY RAISED* by a
>        raised statement.
> 
> All of the problem issues go away with those requirements in place, and
> you only have the issue of how to actually write the patch.  Earlier
> discussions indicated, it might not be that hard to do.

I'm not familiar with these earlier discussions. Did they go
as far as sketching a feasible implementation? It's all very
well to propose things like this, but the devil is very much
in the details.

-- 
Greg



More information about the Python-ideas mailing list