i wasn't even thinking about a change, may be better Exception message, 
that is all. 
or event better: immediate exception InvalidStateError just when i called 
set_exception to prevent me doing something that "should not be done"

basically that "double error"  StopIteration + InvalidStateError  just 
confused me. 
because it gave me no trace to the real source of the problem, the earlier 
call of "set_exception" which went good (at first glance).

i guess that StopIteration just comes from the end of coroutine, because we 
iterate over it?
that is "natural exception" and it could not exit it properly and created 
another.


On Thursday, October 1, 2015 at 12:26:21 AM UTC-4, Guido van Rossum wrote:
>
> There are many excellent reasons why the mechanism I've described won't 
> change.
>
> I guess you could do this:
>
> try:
>     raise RuntimeError
> finally:
>     <cleanup>
>
> But personally I would just write
>
> <cleanup>
> raise RuntimeError
>
> If <cleanup> is a lot of code put it in a helper function.
>
> --Guido van Rossum (python.org/~guido)
>

Reply via email to