[issue24697] Add CoroutineReturn and CoroutineExit builtin exceptions for coroutines

Stefan Behnel report at bugs.python.org
Thu Jul 23 22:27:26 CEST 2015


Stefan Behnel added the comment:

> Hm, I think there's little need for new exceptions...

While I agree with Yuri that the names are a bit awkward, I actually second this. The StopIteration is almost an implementation detail of how the return value is passed on to become the (Future) result of the coroutine. It is intended to be caught by some framework and users would not normally get to see that exception. There is little room for general confusion.

----------
nosy: +scoder

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24697>
_______________________________________


More information about the Python-bugs-list mailing list