2014-11-28 3:49 GMT+01:00 Nick Coghlan <ncoghlan at gmail.com>: > I think between contextlib and Trollius, the case is starting to be > made for raising an UnhandledStopIteration subclass of RuntimeError, > rather than a generic RuntimeError. I modified Trollius to test such idea: * Return inherits from Exception (not from StopIteration) * on Python 3, @trollius.coroutine wraps the coroutine to catch Runtimerror: if the exc.__context__ is a StopIteration, return exc.__context__.value The test suite pass with such additional coroutine wrapper on Python 3.5 patched with pep479.patch (and unpatched Python 3.3). So yes, it may help to have a new specialized exception, even if "it works" with RuntimeError. The drawback is that a new layer would make trollius even slower. Victor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4