How the heck does async/await work in Python 3.5

Ian Kelly ian.g.kelly at gmail.com
Sat Feb 20 04:11:33 EST 2016


On Sat, Feb 20, 2016 at 1:49 AM, Chris Angelico <rosuav at gmail.com> wrote:
> Definitely seems like it should be fixed, then; the current behaviour
> is that Future.result() raises RuntimeError if you raise
> StopIteration, so having await do the same would make sense.

Future.result() itself simply raises the StopIteration. If you call it
inside a coroutine (which seems odd -- why not await it?) then it's
the coroutine that reraises the StopIteration as RuntimeError. The
__future__ import doesn't even seem to be needed in this case.



More information about the Python-list mailing list