Guido van Rossum wrote: > The issue here is that asyncio only interprets StopIteration as > returning from the generator (with a possible value), while a Trollius > coroutine must use "raise Return(<value>)" to specify a return value; > this works as long as Return is a subclass of StopIteration, but PEP 479 > will break this by replacing the StopIteration with RuntimeError. I don't understand. If I'm interpreting PEP 479 correctly, in 'x = yield from foo', a StopIteration raised by foo.__next__() doesn't get turned into a RuntimeError; rather it just stops the sub-iteration as usual and its value attribute gets assigned to x. As long as a Trollius coroutine behaves like something implementing the iterator protocol, it should continue to work fine with Return as a subclass of StopIteration. Or is there something non-obvious about Trollius that I'm missing? -- Greg
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