2015-02-11 20:22 GMT+01:00 Andrew Svetlov <[email protected]>: > Victor, I mean replacing > > def consume_coroutine(): > coro = coroutine(5) > try: > next(coro) > except StopIteration as exc: > return exc.value > else: > raise Exception("StopIteration not raised?") > > with > > def consume_coroutine(): > yield from coroutine(5) > return
Calling your consume_coroutine() function will not consume the coroutine(). It just creates a second generator, no? Victor
